The D40 is an excellent DSLR to start with, I started with the D40x, same controls but with a 10.2MP sensor.
The thing with these bodies is, they are devoid of many of the bells and whistles the more advanced models have that would just confuse you anyway. All you really need is the P, A, S, and M modes(I would work on them in that order), keep it at ISO 200 as much as possible but bump it up as needed, and match the white balance to the situation. That's it. Don't worry yourself with how many shots it can take per second, the dynamic range of the sensor, the noise performance- a lot of folks argue about minutiae such as this on the internet, just focus on learning to take a nice, sharp photo that you'll look at and say "cool, I took that."
You do need to concern yourself with a lens- depends on your level of interest. If you forever remain a casual shooter, you'll love the shots you get from the 70-300mmVR. If you get caught up in the uploading to photo sites such as this one, you could also find yourself lusting after very expensive lenses. I would go with the 70-300mmVR, 55-300mVR, or the 55-200mmVR to start with, that should last you a couple years till you get the hang of shooting, before investing in serious glass.
Don't forget to enjoy it, it's very easy to get distracted with the gear side of things