I'd consider the 7D a major step up in terms of usability and camera function. I also find the images nicer out of a 7D as well, some of it is probably placebo, but there is a huge improvement in terms of image noise/resolution. I also like the screen a lot.
It's the same with the 5D but you will definitely produce a finer product OOC and you get the added bonus of real focal lengths. You will also notice the performance gap to the 7D, the 7D is faster. That said, unless you are using the body at the extreme end of the conditions it was designed for, it's not that big of a difference.
A camera's day-to-day performance is much more important to me than the very minute differences in IQ, and they are very minute. To me all the modern dSLRs are basically the same IQ unless you plan on very very specialized use of your equipment, especially if you shoot raw and process them afterward.
The 7D is a worthy upgrade to the 40D, at this point I'd wait on a newer 5D if you decide to go that way. All in all, right now is about the right time to look to upgrade from a 40D, the new features on bodies 2 gens ahead are really worth it.