There's no doubt that the EOS 50D outresolves the EOS 40D, just as you would expect it to with the pixel count going from 10MP to 15MP. In theory that would give you about a 22% gain in linear resolution, based on the Nyquist sampling criterion and if all other variables were equal (such as the effect of the anti-aliasing filter, the RAW file demosaicing algorithms and assuming the lens being used didn't limit resolution).
The image below shows the difference observed at ISO 100, using an EF 50/1.8 lens at an aperture of f4.
If I use these images to calculate the actual resolution at the sensor I get about 70 lp/mm for the EOS 40D and 80 lp/mm for the EOS 50D. If you prefer units of "Line Widths per Picture Height" (which I don't!), the numbers are around 2050 LWPH for the 40D image and 2350 LWPH for the EOS 50D image. I stress that these are approximate values. Resolution is somewhat subjective when measured using line charts. Whatever the actual numbers though, it's clear that the 50D is better.
In a number of tests it also looked to me as though the 50D images where subject to less aliasing (false color and moire effects) than 40D images, based on using RAW files and Canon's DPP v3.5. This could, I suppose, reflect a difference in the strength/effectiveness of the anti-aliasing filter on the 50D's sensor. It's not something I looked at in detail, but just something I noticed when working with the resolution test files.
On the subject of resolution, I've seen the statement repeated a number of times that in order to take advantage of the higher resolution of sensors such as the 15MP sensor in the EOS 50D you need to use the best "L" series lenses, and maybe you even need to use them at their best aperture, in order to see the higher resolution. Well, it turns out this is just not true.
I tested the 40D against the 50D using the worst lens I had available, the original EF-S 18-55/3.5-5.6 kit lens. Now this isn't by any means an awful lens, but on the other hand I don't think anyone's going to claim that a $100 all-plastic consumer zoom kit lens has world class optics! To further accentuate any shortcomings I shot with the lens wide open for one series of tests and stopped all the way down to f22 (and even f36) in a second series. At f22 (and even more at f36), the performance of the lens will be significantly compromised by diffraction. My question was would the 50D outperform the 40D under these conditions? The answer is revealed below.
As you can see, even with a very basic lens, the EOS 50D reveals more detail than the EOS 40D. If you stop down to f22, which is an aperture at which diffraction effects significantly soften the image, you can see the results below:
Again I think it's clear that the EOS 50D is resolving a little more detail. Look at the "2.5" line set. The difference isn't huge, but you wouldn't expect it to be. At f22 the maximum theoretical resolution of the lens would only be 72 lp/mm. Of course you have to remember that these are 100% crops. If you're using a 17" monitor with 1280 horizontal resolution (which is pretty typical these days), they'd represent sections of a very large print (of the order of 24" x36"), so we're looking very closely at small details here. In an 8x10 or 11x14 print viewed from a normal distance of 2ft, I'm not sure you'd see a lot of difference.
The bottom line is that the EOS 50D resolves more image detail then the EOS 40D, and it does so with just about any lens at just about any aperture. You don't need expensive "L" series primes to realize the higher resolving ability.