I was having tons of problems trying to figure out materials and lighting under Direct3D9, last night I made tons of progress after fooling around so much. I used the D3DXCreateTeapot() function and applied a material and lighting when I compiled I was greeted by this beauty...!
http://oi55.tinypic.com/315xvus.jpg
I quickly implemented more camera functions so that I could pan around and look at it from all sides watching the effect of this DIRECTIONAL light. I screamed a big YES!! When I finally got it to work, I also got z-buffering to work as well!
The MinGW compiler with the DevPak for Dev-C++. I created a fake Dev-C++ directory and installed the package over it, then moved it over to the MinGW directory located in Code::Blocks, works like a charm!