Have you test driven any contenders yet? If so, what did you like and dislike? Even if not, which cars do you find attractive, and which have you enjoyed driving in the past? Knowing this would help narrow the field.
Also, how large a car, and how many features do you require? You can get a BMW 328i for $40,000, but it won't have many options.
As is, few new cars feel insubstantial, and we seem to receive significantly fewer rattle complaints than we did even a few years ago.
A Buick Regal feels very substantial and is very quiet, and the suspension of the GS is quite firm.A Ford Fusion similarly has a European feel, but for a little less money.
A Cadillac ATS with the features you want likely lists for over $40,000, but dealers could be discounting them significantly.
Among Japanese cars, an Acura TL SH-AWD might deliver what you're looking for (though Acuras seem more prone to rattles than most luxury cars). Or maybe a Lexus IS 350. But $40,000 would likely mean no nav on the former and no options at all on the latter. A leftover Infiniti G37 might be a good value play.
Among European cars, the new 2015 Audi A3 would probably include the most features for a price under $40,000 while delivering the driving experience you seek.