The Heavy and Medic make a dangerous pair, but since the other classes here also are very important to capture the flag, like the Scouts and Spies, it's wise for the Medic to team up with them too. They're two classes with low health, and anytime a Medic is with them, they obviously have a less chance of dying and easier time moving ahead.
Another teamwork strategy is to pair up with another Medic who is charging a Heavy. You give this Medic a better chance to survive and now him and his partner are even more of a threat; plus, you're their backup plan in case someone dies or their ubercharge bombed on them.
Two Medics working together may sound weak, but in truth, they can be a dominant force against a defense. With this strategy, you have two strengths- both of you can heal each other and create your own ubercharge. Imagine how that can cause a lot of problems for your opponents. You will not die easily and this should give you ample opportunity to confidently attack the enemy base; your primary and melee weapons become quite effective under this occasion. The two Medics strategy is capable of destroying sentries and enemy groups.
So remember that the Medic is not just a healer, but a powerful weapon as well, and can help open the pathway for the rest of your teammates to move up ahead.