Preheat oven to 375 degrees F. Lightly grease four 12-ounce individual casseroles or one 1-1/2-quart au gratin dish; set aside. In a 4-quart Dutch oven, cook pasta in boiling, lightly salted water according to package directions, adding spinach and mushrooms for the last 1 minute of cooking; drain.
Transfer pasta mixture to an extra-large bowl. Stir in dried tomatoes and olives. Add pesto and vinegar; toss gently to coat. Transfer mixture to the prepared casseroles or au gratin dish.
Bake, covered, for 20 to 25 minutes or until heated through. Top with cheese. Bake, uncovered, about 10 minutes more or until cheese is melted. Let stand for 5 minutes before serving. If desired, sprinkle with basil. If using individual casseroles, each dish will serve two.