It is unclear to me if the original poster was looking for a viewer or a means to interface the camera with his computer. A quick search indicates that the Nikon D40 uses the PTP protocol.
http://www.gphoto.org/proj/libgphoto2/support.php
If you want to keep your system simple use the libgphoto2 (backend) and gphoto2 (Command Line front end). Other front ends are gtkam, digikam. Larger desktop environments also can show the gphoto libs in a file browser.