My first person camera is rolling when I move the mouse in circles.
if this is like a first person shooter where you just want to pitch and yaw, then the yaw axis you want is your world up axis
your code sample rotates around LOCAL axes (like a fighter plane sim). for 1st person shooter, you want to rotate around WORLD axes. local axis rotation is only really required with true 3 degree of rotational freedom flight simulations.
as for "roll"....
if by that you mean the ship starts to roll as you yaw and pitch, this is most likely due to floating point imprecision, and not re-ortho-normalizing your forward, up, and right unit vectors.
as you apply successive incremental rotations to your local axes, they skew due to floating point imprecision. gramm-shmidt LARGELY fixes that: up=fwd X right, right=fwd X up. need to keep them all unit vectors as well, as i recall. its also possible to use other methods of storing orientation that don't have the precision problem of floating point mats and quats.
as stated above, if you want first person shooter type rotations, you want PAN and TILT (rotations around global y and x respectively, left hand coordinate system), not YAW and PITCH (rotations around local y [up] and x
axes respectively, LH coord sys).
try D3DXMatrixRotationX(&T,&T,pitch_angle) and D3DXMatrixRotationY(&T,&T,yaw_angle). note that call order is important. you can call in either order, RotX then RotY, or vice verse, but you must use that same order everywhere in your code for consistent results. Xrot followed by Yrot gives you pan and tilt behavior like a camera, which is what FPS shooters do.