You want to search for info on the Direct3D State Tracker, eg :
Gallium3D provides a "hardware layer" (standard interface for HW drivers) which supports a number of different state trackers, each implementing one or more higher level APIs. The most commonly used state tracker is for OpenGL, but there are others as well.
Wine normally operates by translating Direct3D calls into OpenGL calls then calling the OpenGL driver (which may in turn use Gallium3D as a hardware layer), but in principle Wine could include the Direct3D state tracker and pass the Direct3D calls to it instead. Not sure of the status of that - you may still have to build the Direct3D state tracker yourself from source (see source link in article above).
For programming examples I guess the best place to start would be the test programs in the state tracker tree :