Ogre3D itself cannot handle that situation as it is a pure rendering engine, hence you need some input library. The standard solution for Ogre applications is using OIS which even comes bundled with Ogre.
What you then need to do is to create an OIS::MouseListener (e.g. by letting your main application class inherit from it) that will deal with your mouse move events and react accordingly, in your case rotate the camera.
bool YourClassInheritingMouseListener::mouseMoved(const OIS::MouseEvent &evt)
m_pCamera->yaw(Degree(evt.state.X.rel * -0.1f));
m_pCamera->pitch(Degree(evt.state.Y.rel * -0.1f));
For a more complete example have a look at the BasicOgreFramework I created which handles mouse movements to rotate the camera as well as keyboard input to move the camera.