If you look closely, you'll almost always note that the mirror is angled so the camera is out of its view. This is sometimes masked by the actor looking directly into [the reflection of] the camera, which gives the impression that he is looking at himself in the mirror.
However, there are at least two other options for getting a shot in which the camera should, by rights, be visible but isn't:
The other was used by James Cameron in Terminator 2: Cameron wanted a tracking shot (camera moving sideways) behind Linda Hamilton removing a chip from Arnold's head in front of a mirror. If done with a mirror, the camera would have been visible as it moved around behind the actors.
Rather than do this with effects, the set was built so that the mirror was actually a window, and on the other side was a complete mirror-image version of the set on the camera side. Schwarzenegger and Linda sat on the far side facing the camera, and a fancy Arnold puppet and Linda's twin sister sat with their backs to the camera, mimicking all of the moves of their counterparts.
Other examples of this are:
In the case of Being John Malkovich, where the shot was from his POV the camera man just stood in front of an empty frame in the wall with Malkovich standing 'inside' the wall on a reverse set of the scene...
In the bad attempt of Sucker Punch scene in the dressing room when Sweet Pea, Rocket and Blondie talk about not helping Baby Doll, their movements not matching their mirror images (especially Sweet Pea's). Doubles are being used. This is done so the camera can move behind them without being reflected. You can watch it at this link
Black Swan featured several shots in mirrored dance rehearsal studios where the crew were digitally removed - see below
There are several techniques when mirrors or reflective surfaces are involved in movies.
One is simply to remove digitally the camera and the crew that could appear in the reflection. Sometimes this (already classic) technique involves taking pictures of the real set, and using them to "cover" what should not be in the image.
And a more interesting technique is to use another cameras to capture "what should be seen in the reflection". This means that the main camera keep the story going, but another cameras placed in strategic points register what might be seen in reflective surfaces. Example of this could be seen in Divergent (2014) and Snow White and the Huntsman (2012)
Divergent example: http://www.fxguide.com/featured/divergent-making-the-mirror-room/
Snow White and the Huntsman example:
One simple way is to use tilt-shift lens. It's often used by photographers for static images although I'm not sure if it's commonly used for animated movies or not. Simply put the camera aside from the mirror then shift the lens towards it. The perspective will be fixed by the lens so that viewers will think that the camera is in front of the mirror. However those lenses are very expensive so nowadays people may use a normal lens then correct the perspective later by Photoshop, Premiere or similar software.
There's a great demo video on that. Thanks Rob for the comment
But for complex scenes people will have to use CGI anyway
There are many ways to do it, depending on the scene. A common way to do it is with post processing, by covering the camera with an image of the same static background before placing the camera.
This is a very old question, and there are some good answers. I just wanted to add another excellent example from the movie White Nights (1985), starring Gregory Hines and Mikhail Baryshnikov. In the scene where Gregory tap dances in a studio, the camera pans with him as he runs in front of a wall of mirrors. You can see it at 2:11 in the YouTube video below.
I had to watch the movie twice in a theater to figure out how they did that! If you look closely, you'll notice that Gregory's reflection disappears briefly. That's because the two mirrors that should be reflecting the camera are actually angled slightly away. Specifically, the mirror to the right of the camera is angled to the right, and the mirror to the left of the camera is angled to the left. Neither of them reflect the camera. You can see this when Gregory runs past; his reflection disappears for a few frames.
The third picture above doesn't show his reflection (and not just because he's blocking it).