For the three-quarters shots, if you want to pan, bear in mind that you'll probably have to zoom out a little bit while taking the photo as well, as the car is not only moving to the right/left of the frame, but also moving towards you. If you can, get a lens with a massive aperture, set it to the minimum f-stop, and focus just in front of the car you want to be in focus. If done right, the car will be in focus, and the background will be nicely blurred. Of course, a downside to this is that you won't get any wheel blur in your shots. If you want wheel blur, when you'll have to pan. In my opinion, it's much easier for shots perpendicular to the cars than for ones three-quarters on. Still, best of luck, it's not easy getting used to panning, but when you do, you'll be amazed. Go get 'em :mrgreen:.
Also, Puyjapin, if when you mean "auto refocus" you mean continuous-servo AF, then yes, the D40 has it. Look in page 23 of you manual for more info. Also, there is no "best" lens for anything. If you can, before the day, see where you'll be standing, where the cars are, and test different lenses out. Failing that, just pack everything into your bag and hope for the best.