Hello and welcome!
As long as you liked your Rebel, there is no reason why your 40D should displease you. The cameras should be really similar in their operation and settings.
Have you checked to make sure the exposure value is not offset? Or maybe you were in manual mode? Or in Tv or Av mode with a setting that would lead to underexposure? Maybe the camera is set to spot metering?
I would recommend resetting the camera to factory values (it should be easy in the menu) and then set its parameters to your liking. Then test it again, and see if the images still look too dark. If it still does, show us some examples to compare, and include the EXIF data (see here if you're not sure what it is :
http://www.digicamhelp.com/learn/glossary/exif.phpLet us know how it works?