The Maya Developer Kit contains the following hardware shader node plug-in examples:
vp2BlinnShader: simplified example that uses an MPxShaderOverride. The plug-in shows the usage of the basic interfaces for this type of override.
MPxShadingNodeOverride / MPxSurfaceShadingNodeOverride based
Attribute matching functionality
Functionality to dump fragment code (procedures that define a shader effect) from existing nodes
This feature allows you to examine Maya's internal fragment implementation. Fragments can be used for MPxShadingNodeOverride / MPxSurfaceShadingNodeOverride based shader nodes.