Here are the important code lines I used to specifically handle fog.
Global declarations:
float3 CameraPosition : CameraPosition;
float fogNear = 100;
float fogFar = 1000;
float4 fogColor = {1.0, 1.0, 1.0, 1.0};
Vertex Shader output struct:
Vertex Shader:
float3 WPos=mul(IN.Pos,World);
OUT.wpos = WPos;
Pixel Shader:
float4 color = (diff*Att) +(GlobalSpec*spec*Att) + amb;
float d = length(IN.wpos - CameraPosition);
float l = saturate((d - fogNear) / (fogFar - fogNear));
color = lerp(color, fogColor, l);
Hope this jump starts you.