In many versions of Sherlock Holmes, including the original, Dr. Watson. An actual MD (back when many "doctors" weren't), a war veteran, a skilled marksman, patient enough to put up with Holmes and smart enough to ask him the right questions. This man deserves a medal. Subverted in that Holmes is far from incompetent, and capable of handing ass himself.
In Harry Potter, Hermione does roughly ninety percent of all magical research that the lead trio requires. She also ties with Dumbledore in terms of the amount of useful information she provides Harry with. That's not to say the rest of the trio isn't competent. In the end, it was an equal partnership. On the villainous side of things, Barty Crouch Jr. was much more efficient than all the other Death Eaters put together. He even managed to fool Dumbledore for over a year. Notably, like Hermione, he was the top student of his class at Hogwarts.
Shelena from Loyal Enemies, when she works for a herbalist. She's a werewolf, able to smell whether a plant has any medical properties and what are they, making her natural healer. Her boss, on the other hand, seems to be more lucky than skilled and many of his mixtures are ineffective, if not outright harmful. The people in the town where she works caught up on that, and she makes extra profit from selling her mixtures out of the shop, where she doesn't have to pay the man his share of income.
Teresa of Dora Wilk Series. She's been a seneshal (second-in-command) of another vampire for years before Gajusz picked her up. She's capable of translating his "do this, now!" into coherent orders, she's able to organize everything in the nest while he's only playing inter-nest politics, she's able to smooth his fits of rage into relative calmness, she's able to aid him even when he clearly doesn't want help... It's insinuated that Gajusz would fall long ago if not for her.
Jame Retief, in Keith Laumer's Retief series of SF diplomacy stories, is always one rank below Magnan, despite being the only effective one of the pair. Of course, his techniques weren't terribly diplomacy oriented. Almost the whole point of the series was that the diplomatic corps is utterly useless, and only by breaking their (incredibly involuted and wrong-headed) rules can Retief achieve the supposed objectives of policy.
Atlas Shrugged: Jim Taggart is CEO of Taggart Transcontinental, but his sister Dagny actually does all the work.
In Phule's Company, Phule's butler Beeker calmly and practically organizes everything that the intensely focused and somewhat hyperactive Phule ignores when he's distracted by the big picture.
He also invested his considerable pay to such good effect that he could probably retire to a private planet if he wanted to.
In Miquel de Cervantes's Don Quixote Sancho Panza occupies this position by the sheer fact that he's not completely crazy. This trope is older than the Enlightenment.
Sydney Carton from A Tale of Two Cities is the Hypercompetent Sidekick to his boss, C. J. Stryver. He does all the paperwork and is responsible for winning the one case we see them handle. He has no ambition, however, while his boss Stryver is always shouldering his way through life.
Burtsev and several other exiled Decembrist officers are this to supposed General Failure Paskevich in The Death of the Vazir Mukhtar. Each of them manages one of the crucial areas of warfare, and their efforts seem crucial to all of Paskevich's victories.
Fisk is this to Michael in the Knight and Rogue Series as the squire, he's the one that comes up with all the plans and always rescues Michael after some botched scheme by his 'employer'.
In The Shahnameh, the ever-more reluctant Rostem is this to Kay Kavus, who is constantly leading Iran into trouble.
Milo in the Gaunt's Ghosts series leans towards this in the first few books. He's unfortunately so good at his job that he attracts the attention of the Inquisition, rightly thinking he's a previously un-identified pskyer. He later leaves Gaunt's side to become a full time soldier and even later he becomes a sidekick for the saint Sabbat.
Captain Carrot is strong enough to punch out a troll, idealistic enough to make up for the combined weight of Ankh-Morpork's cynicism, and is charismatic (and quite possibly intelligent as well) enough to make sure said idealism doesn't get him killed/beaten. And he still takes orders from Sam Vimes. Who's admittedly a badass, but still, as one character in Jingo noted, "[Carrot] can make water run uphill, and he has a commander..." Pretty much everyone knows he's the heir to the throne, but he steadfastly denies it except on a very few
#3 in the Watch hierarchy is Angua, a gorgeous werewolf with an amazing sense of smell, super strength, and the ability to regenerate from almost anything. The only reasons she isn't a Mary Sue are that a) the criminals all know there's a werewolf in the Watch, so silver and peppermint bombs are becoming standard and b) Terry Pratchett is a freaking genius.
Vimes' Battle Butler, Willikins, shows aspects of this trope as well. Not only is he Vimes's preferred backup when trouble breaks out away from Watch jurisdiction, but he's taken it upon himself to do whatever's needed to guard the Vimes family ... up to and including eliminating villains whom Vimes' own conscience couldn't handle killing outright.
In Monstrous Regiment, while Lt. Blouse was smart and competent in his own way, it was the veteran Sergeant Jackrum who's practical and kept the squad of newbies alive by various means. In fact, all officers (or "ruperts") were basically there to be manipulated by Jackrum——from his own lieutenant to the Borogravian High Command. The main character, being an Only Sane Man among the recruits, is praised by Jackrum to be great sergeant material. She's promoted to Sergeant by the end of the book. This was presumably a reference to this trope common to war works (and real life), where the veteran non-com is saddled with an officer fresh out of the academy.
One story in The Escapist emphasized this aspect about Big Al, the Escapist's 8-foot-tall, philosophy-quoting sidekick. A bad guy points out how much tougher and smarter Big Al is, yet he plays second banana to the Escapist—to try to recruit Big Al to the evil organization. (The story was probably a self-conscious comment on comic-book tropes.)
Gunner Jurgen, aide of Ciaphas Cain, possesses the incredibly rare talent of being able to nullify Warp powers within a certain area of effect. This (and his melta) often come in handy for saving Cain's posterior in situations that would probably have gotten him killed long ago otherwise. The fact that he's a blank is part of the reason no one notices him. As the author has joked, if anyone actually noticed Jurgen, he'd probably be the famous one. (Though the idea would probably horrify him.)
He'd probably fit the trope even without his Blank abilities: He's an incredibly good driver of vehicles ranging from luxury cars to APCs, a crack shot with his Lasgun, capable of out-obstructing even the worst Obstructive Bureaucrat and can scrounge up pretty much anything Cain needs, from luxurious lodgings and food in the middle of a warzone to staff cars, heavy weapons and restricted armor. And as the short story The Smallest Detail shows, he can be quite cunning as well.
Astromech Droids in the Star Wars Expanded Universe. Other than R2D2, the X-Wing novels brought us Corran Horn's droid Whistler, who can circumvent restraining-bolts thanks to a custom internal lay-out, has advanced data-gathering programming for criminal investigation purposes and once ran a minor pro-New Republic resistance cell on a minor Imperial world. Other notable droids included Emtree, who operated a commodities brokerage out of the Rogue Squadron barracks until they were forced to throttle back his programming, and Tonin, who helped Lara Notsil to infiltrate and practically take over a Super Star Destroyer, which functioned as The Mothership of the Big Bad of the series.
In Harry Harrison's The Stainless Steel Rat Wants You involves a full-blown alien invasion on humanity. One of the aliens' first acts is to kidnap all the high-ranking military leaders, who have gathered on one space station for a conference. The book notes that, after their subordinates took over their superiors' responsibilities, the effectiveness of humanity's military rose dramatically.
It would be stretching to call the Princess Ren of A Brother's Price "incompetent", but she is inexperienced and still trying to adjust to being the leader and the Eldest Princess, even six years after her older sisters died in a theater explosion. She relies rather heavily on the experience and advice of Captain Raven Tern, and as the novel progresses the Captain is never pushed aside, but Ren comes to stand on her own more.
Toros Revoke in Ravenor is the most dangerous and competent of the Secretists, yet remains a loyal "just doing my job, sir" to Jader Trice.
Pular Singe from the Garrett, P.I. series started out as Garrett's insecure young apprentice, but has evolved into this as she's matured and begun trusting in her own talents.
In A Song of Ice and Fire, the Hand of the King is supposed to be this to the King. Twyin Lannister almost singlehandedly brought about decades of prosperity to Westeros when he was Hand to Aerys, while Aerys was well on his way to earning his "Mad King" moniker. Deconstructed since Aerys became jealous of Tywin, culminating in him snubbing Tywin by rejecting the marriage proposal between his son Rhaegar and Tywin's daughter Cersei. He even had the gall to dismiss Tywin as a mere servant. Tywin retired from being the Hand in response, and the Kingdoms quickly went to hell after that.
Davos is this to Stannis, while Stannis is more than capable of leading an army, Davos is the one who can keep it together, and gain more allies for Stannis, as his lord isn't much of a people person, and keeps him from being to influenced by Melisandre.
Lord Randyll Tarly is this to Lord Mace Tyrell. While Mace is the lord of the Reach, with the Tarlys underneath him, he's quite a buffoon. Whenever people mention the success of the armies of the Tyrells and the Reach, they're really referring to just how dangerous of a soldier and battlefield commander Randyll Tarly is.
Psmith was originally introduced into P.G. Wodehouse's ongoing Boarding School serial as cricketeer Mike Jackson's sidekick, but took over the series to the extent where Mike only existed to be saved from various authority figures by his Guile Hero antics.
Archie Goodwin from the Nero Wolfe books. Wolfe is certainly no fool, but he is incredibly slothful, misanthropic and reclusive, and would be happy to spend his entire life alternating between tending to his orchids, eating and reading books if given the opportunity. Archie, on the other hand, is the one who does all the actual work — he nags Wolfe into taking jobs, he puts Wolfe's orders into effect, he gathers the evidence and witnesses for Wolfe to piece together the mystery, he manages Wolfe's finances to allow him to live his opulent lifestyle, and so on. He's even responsible for maintaining the germination records for Wolfe's beloved orchids.
Gilly serves as Maledicte's butler, spy, secretary, conscience, muscle, seer, and, on one occasion, poisoner. And he's good at all of it.
Literature/New Amsterdam's Jack Priest belongs to two revolutionary movements, speaks multiple languages, flirts his way into confidential documents, can find anybody, and provides much-needed blood to his vampire employer, Sebastien de Uloa.
Although she becomes a POV character in The Mirador, Mehitabel first appears as this in The Virtu. Thanks to her geographic knowledge, quick thinking, and ability to go undercover as anybody, Mildmay and Felix actually manage to survive Kekropia and rescue the victims of a witch hunt to boot.
TimeRiders features the support units Bob and Becks, especially with Becks. While Liam is the leader of all field missions, it is invariably the support units who bail him out of trouble. They are both stronger than regular men, faster, and are able to process an obscene amount of tactical data in a second. Becks especially qualifies, as she doesn't have the sheer size or strength of Bob, but is no less ruthless and often seen as cruel or monstrous in her ability to dance all over the enemy, exploiting tropes like the Honey Trap. But both swear undying loyalty to Liam, and to start with are near-incapable of independent decisions - they don't just accept being the sidekick, they require it.
Nick in the Diamond Brothers series. His Too Dumb to Live older brother Tim (actually named Herbert Simple) believes that he's a world-famous and brilliant detective, while Nick actually does almost all of the real detective work. Nick is usually the one who actually solves the case at the end.
In Safehold, Rayno slowly turns into this as his boss, Clyntahn, descends into Villainous Breakdown. By book eight, if it wasn't for the archbishop, Zion would be all but depopulated by reprisals, everyone with shred of competence in Church forces would be dead by Punishment and the Army would collapse onto itself.
In Wolf Hall, Thomas Cromwell occupies this position for everyone he works for as soon as he leaves home, starting with some Dutch merchants who need some help dealing with customs agents. After he returns from mercenary work on the continent he helps a cloth merchant named Henry Wykys put his business into order (an appreciative Wykys suggests Cromwell marry his widowed daughter in appreciation, and it's a happy union), then he becomes Cardinal Wolsey's most valued man for his legal knowledge and considerable cunning. After Wolsey's fall, Cromwell becomes Henry VIII's right hand and is given the important but vaguely-defined position of Master Secretary, which affords him tremendous latitude to do whatever he thinks is necessary for Henry and the realm.