The HP Boost does not stack with the medic-gun.
It heals for 60 HP, and bumps the max HP by 50. At the end of the 30 seconds, the extra 50 HP disappear immediately. If you are above 300 HP at the time, you are reduced to 300 HP (assuming no over-heal). Otherwise, there is no change for your current HP.
If you are currently buffed to 350 by the bar, a health-pack or resupply cabinet will heal you up to 350 HP. However, it appears that dispensers will only heal you back to the original 300.
There is more detail at the official wiki.
Certain classes are better against certain other classes.
In general:
Heavy is weak against Spy, Sniper, and Demoman.
Heavy is strong against Scout, Pyro, and Medic.
Heavy is even (more or less) against Soldier.
An Engineer versus Heavy depends entirely on if the Engy has a level 2-3 sentry or not. A mini-sentry or level 1 sentry will almost always see the Heavy win at full health. In this case, the Engineer should flee. If he was building mini-sentries, building them as you flee is an excellent idea, as it will slow the Heavy down to kill it, or make him ignore it to chase you, dealing him damage all the while.
Medic is weak against Scout, Pyro, and Soldier... well, most of the classes in the game, but those three in particular.
Medic is strong against the Spy, simply because a Medic that continually moves will generally outrun or dodge a Spy's backstab.
The thing is... a Scout has the best chance of killing a Medic if he can manage to get behind the Medic, simply because a medic is a 2-shot kill with the standard Scattergun at close range.
Now, the best defense against a Heavy/Medic pair is to work with your own teammates. If you can take out one of the two, the other teammates may be able to take out the other.
If you really do need to combat them alone, Sniper is likely your best bet. As tempting as it is to go after the Medic first, if he keeps moving, he can generally outrun your scope. However, a fully charged headshot will one-shot the Heavy.
If they Uber, run, unless you're an Engineer trying to keep a sentry nest up. In this case, repair repair repair, and hope that they aren't smart enough to have the Medic block the sentry's knockback effect. If you can get a Pyro to help you by airblasting the Medic or Heavy away, even better.
P.S. NEVER go head-to-head versus a Heavy, he will always likely win simply because of how much damage he does.
Best Answer
A straight ratio isn't the best, because there are some classes that the medic doesn't synergize well with (engineer, spy). A better metric would be 1 medic for every 4-5 offensive classes, so 2-3 medics on a 12 person team.