Hands down the best bang for you buck...well about 350 of them....is the Tamron 90mm 1:1 Macro lens.
Assuming you are using the kit lens that comes with the D40, that would be a 52mm filter thread. I am not positive but you may be able to find a step up ring, that would allow you to put a larger thread size filter on it. If you are able to, i would encourage you to look at the Canon 250D close up filter...they are about 80 bucks...and well worth it...the really cheap ones arent worth the trouble, as they have such a small area in focus...very big PITA. Made that mistake myself.
You will LOVE taking photos 100x more when you get a macro lens, and myself, i would save for something like that....definately worth the money.