I presume you mean a shot while Mother and Baby are still in hospital.
A Nikon D40 is more than capable of this, obviously don't use flash.
Set your camera to Aperture Priority, and select the smallest aperture that will allow a reasonable speed, If you use the focal length of the lens as a guide to shutter speed then you should get a good sharp shot, so if your lens is set on 50mm don't go any slower than 1/50th of a second. Adjust the aperture till your camera is showing a shutter speed faster than 1/50th of a second. This will optimise the depth of field with the available light.
If it is night time (and it usually is) and your shooting under artificial light, read your manual about calibrating colour balance use anything white in the room to set it. If that's not possible don't use Auto white balance, just set it to daylight and adjust later in Photoshop or whatever.
All this gets easier when the Baby is home, of course, then select a 'soft' light (from a North facing window for instance) it will be more flattering to both Mother and Baby using the same technique as outlined above, most Babies have blotches just after they're born, I'm considerably older and I've still got mine. LOL.