In Chung Kuo, Karr is the Lancer to the European T'ang Lord.
Ron from the Harry Potter books fits the definition perfectly. It was a plot point in the first book with the Mirror of Erised. Harry, who lacked ambition and never knew a family other than his abusive aunt and uncle, sees nothing but his parents standing behind him. To contrast, Ron felt crowded as the second youngest of seven kids and dreamed of outshining them all so he sees himself alone holding awards of many kinds.
For a bit of extra symbolism, Ron (short for Rhongomynyad, cutting-spear) was the name of the mythical King Arthur's spear.
In the Myth Adventures books by Robert Asprin, Aahz is the loudmouthed, worldly, cynical Lancer to the quiet, naive hero, Skeeve. The two become more alike as the series goes on.
Commander Vimes from Discworld spins this trope widdershins. He's the protagonist of Watch books, and is the cynical commanding officer of idealistic Hero Carrot. Plus, now that Vimes is Duke of Ankh, he would be Number Two to the king, if Carrot ever decided to actually take the job.
Also as Commander of the Watch and the richest man in the city, Vimes is effectively the second most influential and powerful man in the city, and often plays the Lancer role to the Patrician, though Havelock Vetinari is hardly the traditional hero.
Vimes has his own lancers: depending on the situation, other Watchmen (notably Carrot, Colon and Nobby) and occasionally his wife take turns at it. Angua is probably this most consistently for Vimes, especially in books that don't centre on the Watch. See Monstrous Regiment, for example.
In addition, many other Discworld characters have their own lancers: Colon has Nobby, Carrot has Angua, Rincewind has the Luggage, Granny Weatherwax has Nanny Ogg...
In Animorphs, Marco is Jake's best friend. He shares a distinctly different and darker view; in his more serious moments, he presents alternative — even borderline ruthless — options. He thinks very differently than Jake, which can be useful for filling in blanks, and helps in formulating strategies when Jake has trouble doing so. It should also be mentioned that along with being the cleverest in terms of tactics, he is explicitly stated to be the one who keeps everyone from going insane because the sarcasm, wit, and dumb jokes he uses as his own defensive shields distracts the others from the seriousness and tensions of their often downright suicidal missions, helps lighten the mood, and just generally helps everyone relax.
Unusually for Lancers, Marco doesn't have any interest in being The Hero - when Jake's out of action, Rachel leads the team and Marco serves as her Lancer.
Panther from the Genesis of Shannara books "Armageddon's Children" and "The Elves of Cintra".
In Shannara, anytime a Leah shows up, it's to play this role for the main Ohmsford.
Mudge from the Spellsinger novels is the Lancer for Jon-Tom, being cynical and streetwise enough to counterbalance Jon's idealism, and carefree enough to keep Jon from turning maudlin about his exile in another world. Later in the series, Jon-Tom returns the favor, as his Morality Pet example helps Lovable Rogue Mudge adjust to life as (yikes!) a responsible husband and father.
Lancelot of King Arthur's Court is the original Lancer, both figuratively and literally. He became Arthur's number two immediately after joining and was every bit the socialite that Arthur never could be.
Bigwig from Watership Down is made of this trope, with some of The Big Guy for flavoring. He's unabashedly the foil to The Messiah Hazel, the cynical tough guy acting as a grouchy but loyal second-in-command to the charismatic, idealistic leader.
He does such a good job, that the Big Bad assumes Bigwig is the leader. When Bigwig mentions that he is making his last stand at behest of his chief rabbit, the idea of a rabbit badass enough to boss Bigwig around terrifies the enemy so much they consider giving up their attack.
Patroclus of The Iliad fulfils this role to Achilles' The Hero: more thoughtful and level-headed than his best friend, his death is what snaps Achilles out of his proverbial tent.
The Wheel of Time gives us Mat and Perrin both serving as Lancers for Rand, the first contrasted because of his irresponsibility and refusal to accept destiny and the second because of his devotion to one person over the fate of the world.
In Jim Butcher's Codex Alera series, Antillus Maximus (Max) is The Lancer to Gaius Octavian (Tavi). He is a foil to Tavi in that he is Book Dumb, extremely strong with furycrafting and a hardened veteran of the legions, where Tavi none of the above, at least at first.
Sadrao from Black Dogs is The Lancer of their Five-Man Band. He acts as the foil to Lyra's bumbling, naive, bookishness by being a hardened and competent warrior. As the story progresses, Lyra loses these first two qualities and becomes more and more like Sadrao.
Maybeck in Kingdom Keepers. He is more cynical and grounded in contrast to Finn, which in a Disney work is a disadvantage. He also has trouble grasping the DHI's full potential because he's mentally blocked by his high expectations.
Colt Regan: Colt's partner Alex qualifies, as well as his friend Joseph to a certain extent.
In Stephen King's The Dark Tower series, Cuthbert and Alain are the two trusted companions in Roland's original Ka-tet (as told in Wizard and Glass). Being the polar opposite in personality to the serious, driven Roland, Cuthbert appears to be the lancer of the ka-tet and also the companion that Roland reminisces about the most. Alain could have also been a lancer, except that his cerebral personality is more in tune with Roland's no-nonsense demeanor. Eddie Dean (whom Roland states is much like Cuthbert) would become Roland's lancer later in life.
Bean is the lancer to Ender at Battle School in the Ender series, although Orson Scott Card revisits the story in the Ender's Shadow series to give Bean a badass upgrade
In Margaret Atwood's Year of the Flood, Zeb is the initially the lancer and the muscle to Adam One's founder and moral leader role in the God's Gardeners. A schism eventually leads Zeb to break away into a more militant organization along with a large part of the Garderners.
In the medieval epic poem The Song of Roland, Olivier serves as the Lancer to the main character, Roland. They are life-long companions and rivals (though Roland is stronger) and Olivier's clear-headedness and wisdom serve as a foil for Roland's recklessness and pride, his tragic flaws.
In Honor Harrington, Alistair McKeon best fits this trope for Harrington, even though Michelle Henke is Harrington's best friend. Andrew La Follet could also count.
Honor makes a point of encouraging this sort of relationship with her Executive Officers, as she considers the Captain/XO relationship to be one of the most vital factors in running a tight ship.
While Merlin is the protagonist of the Safehold series, and Cayleb and Merlin work closely together, Cayleb is typically the one calling the shots and the role of Lancer goes to his wife and co-ruler Sharleyan. It's noted by one character that they were working in near-perfect tandem even before they gained access to Merlin's technology allowing them to communicate over long distances.
Joseph Carrion of the Mediochre Q Seth Series is The Lancer to Mediochre. Where Mediochre is an idealist, a Technical Pacifist and a grand believer in using his brain rather than his body, Joseph is a cynical gunman who is very intelligent but prefers scrapping with whoever Mediochre permits him to over serious thinking. He's also fanatically loyal to Mediochre, above pretty-much all other ethical concerns.
Elim Rawne from the Gaunt's Ghosts series of Warhammer 40k novels by Dan Abnett is very much this to the titular hero Ibram Gaunt.