DMPCs do often tend to steal the spotlight, but I've seen it work well under a few circumstances. Basically, if you don't want to give your PC an unfair advantage, do the opposite. Give them unfair disadvantages. Trust me, no one will complain about that.
A prominent mapmaker needs to make a map of some extremely dangerous territory. She hires the PCs to protect herself. She's important to get the PCs paid regularly, and absolutely must come along with the PCs in order to actually map the territory, but she's basically useless in every other regard. She spent almost every combat hiding behind the tanks. Occasionally she would cheer them on (a la bard), but usually she would just hide.
Why this worked
The mapmaker didn't challenge any of the PCs at what they were good at. She let them excel, even demanded it of them. Where the PCs were good, she was useless. People like to be good at things - let them.
However, she wasn't an idiot. She was a real person with thoughts and feelings. She didn't annoy the PCs by constantly making stupid decisions. She was a silly person with silly concerns that the PCs didn't care about, but she didn't constantly throw herself into danger. She helped the group when she could, and stayed back when she knew she was out of her depth. You don't want your RPG to turn into a game of "protect the idiot".
The One-Trick Pony
A group of pirates (the PCs) run across a shipwrecked man and woman. The woman turns out to be a cleric of a god of prophecy, and she foretells the end of the world while recovering from her shipwreck. After some argument, it is decided that ticking off the god of prophecy would be a bad idea, so the PCs go to save the world, even if they are convinced they're gonna die in the process. The prophet (and her bodyguard) come along, because it was her stupid idea in the first place.
The prophet was a useful cleric in a party that didn't have one and played a primarily supporting role, healing PCs that need it. She was clearly there to Advance the Plot, but the things she prophecies usually aren't helpful, but consisted of "Stop this volcano from exploding" or perhaps cryptic directions ("Find the Avatar of Hope") that only become clear after they've discovered the thing anyway. She had secrets, but nothing she knew could help them save the world or defeat the boss.
Moreover, she was a real person and many of the PCs became close friends with her. As the game developed, she went steadily insane (in-game side-effect of seeing the future). While many players would have cast her aside without a second thought, because they were friends the PCs continued to bring her along and care for her, insanity and all, and even tried to save her in addition to saving the world.
Why this worked
None of the other PCs were clerics, so she was important to the survival of the party. She had to be there, but she didn't do anything but healing. Well, and giving them generally unhelpful prophetic messages of doom.
She actively befriended the PCs, and ended up telling them her secret as a mark of trust. It did nothing to change the plot, but it built a bond between her and several of the PCs. They liked her, and wanted her to be around. (One of them even fell in love with her, insanity and all. It was adorable.)
What didn't work
Her bodyguard actually ended up being too powerful, so I would have killed him off early if I were to run it again. His goal of "protect the prophet" generally translated to "kill whatever's threatening the party" and the party didn't really need another tank. They could have protected the prophet just fine on their own.
To Sum Up
Keep in mind these two goals: Need and Friendship. There has to be a mutual need for the DMPC and the party to stay together, and they have to end up as friends, not resenting each other.
- PCs like to be the best at their personal specialty. Let them. Don't make a DMPC that challenges them at the things that they do.
- If your DMPC can do something important and powerful, make sure they can only do that one thing. Your cleric can only heal; your fighter can only take damage (and can't deal enough to bring the enemies down).
- The weaker you can make your DMPC, the better. They need to obviously need the PCs in some way.
- Playing off the players' natural desires to protect certain groups of people can help (children, women, especially if you've got a player that fancies themselves a "white knight", the elderly or disabled, relatives, etc.). Whether or not these groups of people actually need protection isn't relevant - the point is that the players should feel a need to protect the DMPC.
- PCs don't want to hang around with idiots. Don't overdo the weakness part.
- Make sure there's a compelling reason for them to exist, not just "I felt like it". They have to need the DMPC in some way, or they won't want to hang out with him/her.
- Above all, make them human. Make friends with the PCs. Help them out when you can. Get into trouble that you can't get out of on your own. Don't be a PC. Be weak. Be human. Be interesting to the other PCs.
If your DMPC is too powerful, doesn't have a specific need to be there, or antagonizes any of the PCs, kill them off. You don't need a DMPC to have fun.