How are you defining "sharpness"? There are two general definitions -- the "technical" one and what you could call the "aesthetic" or "overall look" one.
Technical sharpness is the ability of a camera/lens combo to distinguish fine detail and render it in a way that will hold up under a reasonable amoung of enlargement. This is best judged at a 100% view.
The other type is where you look at the picture as a whole and say "My, that's a nice sharp picture!" It has less to do with the finest detail and more to do with how the overall scene comes across in terms of contrast that can make things pop out.
There are other factors as well. You mentioned anti-aliasing filters which most digital cameras use to deal with certain digital arifacts and so cause a bit of softenting which needs to be dealt with in post-processing. And, like you said, some cameras tend to have a stronger filter, possibly because those who push the limits of resolution tend more toward the problem.
But, The way to test and compare the 7D and the 40D images would be something like this: load them both into the Edit window (Select them both then click the Edit Window toolbar, or Ctl-Right Arrow, or Right-click and choose Edit in Edit image window).
Both images should open and show in the filmstrip with one in the preview window. You will note that in the toolbar there are buttons for a 50% magnification, a 100% magnification and a 200% magnification.
If you view the 40D file at 100% magnification and the 7D at 50%, you will be looking at similar image sizes and views, I imagine, and it would be interesting to see how the two compare. Then, go to 100% and apply some "input sharpening" to the 7D file and see if that makes a difference.
I have heard that a lot of people routinely apply input sharpening at a certain level to all their 7D files to get them "up to snuff" but not having one, I hesitate from getting involved with such discussions
!
Another thing to try is in-camera sharpening settings -- see if boosting them a bit helps with the 7D. Or, for experimentation, see if shooting an in-camera jpeg with higher sharpening makes an image look better "out of camera" to give you a bit of a clue as to how Canon processes the 7D.