What kind of lens should I buy for my D40?
I have the 18-55mm and want new lens.
Depends what you want man, do you want to do wide angle shots, tele photo zoom, macro etc.?
General rule of thumb, if your happy with the quality of your 18-55mm lens grab yourself the "55-200mm vr" to complent it. The 55-200mm performance is extroadinary in relation to its cost, simply one of the biggest bargain in nikon lens atm. Distortion is relatively low, including Colour fringing - yet images are very sharp and contrasty. If you can afford it and like convenience of having a single multipurpose lens grab the 18-200mm vr lens - but these cost ALOT, like 3 times more than if you get the 55-200mm vr lens (well in AU dollars anyway).
If you decide to want a better quality "kit" go for the 18-70mm vr and 70-300mm vr lens kit. These kits are generally 2x more expensive than the 18-55+55-200, but provide better optical quality performance as well as build quality (metal framing etc.)
Also, as a nikon owner you need to do yourself a favour and eventually pick up the nikkor 50mm 1.8D AF. professional grade lens (in terms of being super fast, high glass quality and razor sharp) at an extremely low cost - anywhere from 50~100 ($USD). Reason why its so cheap is that its a prime lens, and that you wont be able to zoom (which means you gotta move if you want the zoom). The 50mm 1.4 is slightly even better but cost quite abit more - i would consider the 1.8 first. However since you got the d40, note that the 50mm 1.8 lens wont auto focus, so you gonna have to learn to play manual with this one, though trust me you'll grow better at photography while learning how to do stuff manually.
In terms of macro, As i mention on the other page, you can even turn that sweet 50mm 1.8D into a macro lens if you look into buying extension tubes (which are super cheap). But in terms of lens i would recommend the 60mm 2.8D/G ED depending on your budget. and if you want an even closer macro magnification (2:1,3:1,4:1 etc.) chuck that specific macro prime lens on an extension tube!
On another note - any D90 owners here? havent seen any post yet - just recently sold my d80 and upgraded to the d90. Jesus i love this camera, image quality is just as good as the d300 sans the 14bit RAW processing compared to the d90's 12bit. The low light shooting capability (low noise/grain control) on this body is simply amazing and works very well in places such as concerts/clubs etc (and this is without attaching the amazing 50mm 1.8/1.4 prime lens). For anyone thats is on the bench or looking to buy a "prosumer"/mid-tier level camera that you can grow into (lens compatability), I highly recommend this camera.