Since vaccines don't conferr "immunity" they conferr "resistance", herd immunity is actually more than just about Fred.
If you are vaccintated against Anthrax, the white powder doesn't flee the room when you enter, nor does it bounce off your skin. The Anthrax enters your system and your system fights with it. In effective vaccination you are pre-armed to fight the disease off before it becomes fully contageous and, more importantly, before it can become fully harmful and do significant damage to your body and its subsystems.
So lets say there is this disease and everone in a classroom is vaccinated against it, but a substitute teacher brings it into the classroom by teaching a single day durring the communicable phase. All the kids get "a little sick" after suffering one exposure. In effect none of the kids get meaningfully sick, their exposure results in a "sub clinical" illness.
Now lets say that the vaccine is 95% effective. So in a class of twenty kids, one has received no real benefit of from the vaccination. The susbstitute provides one exposure. The one child gets sick and, for ease of numbers, is contageous for three days before being weithdrawn from school. Now each of the ninteen other students was exposed to the disease four times.
Remember that each exposure is a strain on the immune system. There is a small chance that a second child will get sick.
Now lets add one completely unvaccinated child. There is now the substitute and two children who get sick. This is a total of seven exposures to the disease. There each of the vaccinated children is now seven times more likely for their exposure to become intense enough for the disease to become symptomatic and contageous.
Now assume that the unvaccinated child has unvaccinated siblings. That family becomes a hotspot. All the kids get sick. Each kid returns to school and mabye one adds an exposure or three to just one more of the kids in that class. That child is now ten times more likely to become symptomatically sick. Which, should it happen, would cause another three exposures to the entire class.
So put two unvaccinated children in the class,and have a 95% efficacy there is a good chance that one more child will be unprotected and the class will end up with a mortality rate more than the 15% represented by the unprotected kids. 30%, 80% or even 100% normal morbidity (clinical infections with a typical spread for results of disease X) becomes the expected result set.
This is the kind of thing where the anti-vaxxers then see statistics (that they don't understand) that demonstrates that "during such-and-such outbreak most of the overcome were vaccinated" and then conclude that vaccination is unsafe because "most of those overcome were vaccinated." Sure. That is mathematically certian in any community where most people are vaccinated. This is because the distribution is over "most of the people". Doh.
The magic number for herd immunity is about 90 percent. Above ninety percent the herd is effectively immune, below ninety, well "not so much". So a community wide vaccination is only as good as its weakest local links. Given that vaccination is never 100% effective, you need to get nearly 100% vaccinated to become protected above the 90% needed for the herd.
Small, concentrated communities of unvacinated persons act as echo chambers, or detonation zones, so lets say a small community has ten anti-vaxx famlies that all like to get together at the same "health center" or church... Whoops...
Having unvaccinated people in your midst is like inviting suicide bombers to your market place. They are primed, ready to explode with some disease if they get exposed themselves, and they will take out the vaccinated as well. Most of the people killed by terrorists are not terrorists so it is unsafe to not be a terrorist! That's anti-vaxx logic turned into highest hyperbole. But its not terribly wrong.
This video below is narrated by a jackass, but it will give you a nice visual verson of this topic:http://www.youtube.com/watch?v=ZRclbfK5q08
Sorry for his tone, but the math is right, if super-simplified. The "non-classroom" version is kind of funny for its vitriol, but I didn't post that here.