This book (real-time rendering) helped me alot! See on page 66 and 70. It has very good graphics and explenation. Quaternions are on page 72 aswell! :)

[Rotation about an Arbitrary Axis][1]

This renders the camera with the rotation done by mouse input:


    void Camera::getVectors(D3DXVECTOR3& up, D3DXVECTOR3& lookAt)
    {
    	float yaw, pitch, roll;
    	D3DXMATRIX rotationMatrix;
    	
    	// Setup the vector that points upwards.
    	up.x = 0.0f;
    	up.y = 1.0f;
    	up.z = 0.0f;
    
    	// Setup where the camera is looking by default.
    	lookAt.x = 0.0f;
    	lookAt.y = 0.0f;
    	lookAt.z = 1.0f;
    
    	// Set the yaw (Y axis), pitch (X axis), and roll (Z axis) rotations in radians.
    	pitch = m_rotation.x * 0.0174532925f;
    	yaw   = m_rotation.y * 0.0174532925f;
    	roll  = m_rotation.z * 0.0174532925f;
    
    	// Create the rotation matrix from the yaw, pitch, and roll values.
    	D3DXMatrixRotationYawPitchRoll(&rotationMatrix, yaw, pitch, roll);
    
    	// Transform the lookAt and up vector by the rotation matrix so the view is correctly rotated at the origin.
    	D3DXVec3TransformCoord(&lookAt, &lookAt, &rotationMatrix);
    	D3DXVec3TransformCoord(&up, &up, &rotationMatrix);
    }
    
    // The Render function uses the position and rotation of the camera to build and update the view matrix
    void Camera::render()
    {
    	D3DXVECTOR3 up, position, lookAt;
    
    	// Setup the position of the camera in the world.
    	position = (D3DXVECTOR3)m_position;
    
    	getVectors(up, lookAt);
    
    	// Translate the rotated camera position to the location of the viewer.
    	lookAt = position + lookAt;
    
    	// Finally create the view matrix from the three updated vectors.
    	D3DXMatrixLookAtLH(&m_viewMatrix, &position, &lookAt, &up);
    
    	return;
    }

With the mouse input you modify yaw(head), pitch and roll.


  [1]: http://books.google.at/books?hl=en&lr=&id=V1k1V9Ra1FoC&oi=fnd&pg=PP1&dq=real-time%20rendering%20rotation%20about%20an%20arbitrary%20axis&ots=Tr8WlbDFYX&sig=Q9L5fnLIBFL5o8V9A8tMQLZX3nk#v=onepage&q=real-time%20rendering%20rotation%20about%20an%20arbitrary%20axis&f=false