I havent seen any microsoft source or any other dirty stuff but what I know
is that the DirectX dlls call functions like ddentryxx and gdientryxx in
gdi32.dll. (there is a ddrawgdi.h file in the platform SDK I have and there
is also documentation on MSDN for them)
These then call system calls that thunk down into kernel.
In the kernel mode code, I believe that a combination of code in
win32k.sys, code in dxapi.sys, code in dxg.sys and code in the display
driver are what actually do the work. (although I dont know for sure the
relationship or what is going on here)
Also, I dont know exactly how complete it is but I know that the windows
DDK and/or the DirectX SDK includes header files like d3dnthal.h and that
there is documentation for the stuff in those header files in MSDN.