I've not get any particularly appropriate images to demonstrate this but I really like both the 24L and the 35L on both my 40D & my 5D. Having said that I seem think 'wow' more often when I use them on the 5D despite getting good shots with them on the 40D.
I personally feel that the image gap between the 5D and the 1.6x crop bodies is understated. The 40D is brilliant, but the 5D is a lot better for absolute picture quality if less suited to sports / action / bird photography than the 40D.
Having said all that I 100% recommend the 35L on a 40D, and if you can buy a FF body later then you'll just appreciate it even more. What are you looking use the 35L for? I prefer the 24L on a crop body as a walkaround.