If i may post external l inks (Please remove if not allowed). Microsoft has a nice library sharing the whole how to on HLSL: http://msdn.microsoft.com/en-us/library/windows/desktop/bb509635(v=vs.85).aspx
I think eat3d as well has a nice dvd on CGFX if i remember correctly : http://eat3d.com/shaders_intro