Marco and Rachel of Animorphs, with Rachel always jabbing at Marco and his jokes but still having his back when things got serious on them. Likewise, Marco constantly mocks Rachel (like he does for everyone else) as well as occasionally, half-jokingly trying to woo her, but Marco will always have Rachel's back when things get rough.
Really, this applies to the whole group to one degree or another. Marco and Jake were true companions when they were toddlers, Cassie and Rachel have their Odd Friendship, etc. The only real exceptions to this are Ax/everyone else, as Ax is usually polite and respectful.
The Bastard Operator from Hell series has the Bastard and the PFY. Sure they'll zap each other with the over-voltage cattle-prod, but there's no doubt that they're the best of friends.
Polgara and Beldin in David Eddings' The Belgariad 'verse. They basically greet each other with inventive insults (which are left to the reader's imagination). They both, however, admit to being close friends—Polgara typically calls him "Uncle Beldin", as he was one of the people who raised her. It's just their way, and apparently comes from the fact that Beldin is, unquestionably, hideous—so complimenting him would be a blatant lie.
Polgara picked up the practice from her father, Belgarath, who did much of the insulting before she was born and still slings the occasional friendly barb. Beldin would eventually encourage the Nadrak Vella to try her hand at it. It's the first sign of him realizing that his true love may have come at last, as she was the first ordinary woman to look past his ugliness.
Manny Rubin and Mario Gonzalo in Isaac Asimov's Black Widowers series. In "The Wrong House," the guest of the month points it out:
Levan: Whenever I hear two people spar like that, I am certain that there is actually a profound affection between them. Rubin:(revolted) Oh, God. Gonzalo: You've hit it, Mr. Levan. Manny would give me the shirt off his back if no-one were looking. The only thing he wouldn't give me is a kind word.
Mundo Cani Dog and Chauntecleer of The Book of the Dun Cow are faithful allies when push comes to shove. However, the arrogant Chauntecleer constantly belittles the self-hating Mundo Cani, who is all too happy to accept and even agree with the verbal abuse.
Rudy and Liesel from The Book Thief sort-of become friends after Rudy is forced to walk Liesel to school as an apology for hitting her in the face with a snowball, and their interactions always involve lots of cursing and insults.
And Grag (robot) and Otho (android), faithful but bickering allies of Captain Future.
In Hilary McKay's Casson Family Series, one character asks her brother why best friends argue with each other so much more than other friends. His response is because best friends listen to each other so much more than other friends do.
— You spoil me the kid! You teach a boy not to heed his own grandfather! That's your Christian morality? — [...] Just don't scream "Jesus!" if you're such an ardent materialist...
Trurl and Klapaucius in The Cyberiad, up to and including physical beatings.
The Ogg extended family in Discworld is full of a dozen long-running petty feuds and twice as many short-term fights at any given point. However, if any outsider dares to openly agree with any one side, the family, as one, will close ranks, and the interloper might not be long for this world.
Similarly, Nanny Ogg's relationship with Granny Weatherwax:
... [Granny Weatherwax] really couldn't be having at all with Nanny Ogg, who was her best friend. (Witches Abroad)
Rincewind and Twoflower — Rincewind does technically like Twoflower, but he is frequently exasperated and snarky with him. Twoflower never picks up on it. This is especially apparent in their reunion in Interesting Times.
Gaspode is like this with Angua in Men at Arms. Despite having nothing in common, Angua tolerates Gaspode because he is the only being she can be honest about regarding her werewolf nature, and he follows her around because as a werewolf she's one of the few humans who don't ignore him because Dogs Can't Talk. In The Fifth Elephant, Gaspode instead becomes this to Carrot.
Also in Men At Arms, Cuddy and Detritus start out hating each other (Dwarfs and Trolls traditionally do), but soon become this.
A fairly common trope in the pulps as a form of comic relief. For example Monk and Ham of Doc Savage fame.
Dragaera: Vlad Taltos's friends Morrolan e'Drien and Aliera e'Kieron are cousins but act more like siblings—they usually can't be in the same room for more than ten minutes without bickering furiously, but they also often risk their lives for one another.
In one story, the two get in an insult-war with one another so that they can provoke a fight, and kill the other one in an effort to subvert some local hospitality rules and kill someone else.
Played with in Issola, when, after they start in on one of their fights while Vlad is bedridden and can't get away, he gets exasperated and neatly summarizes the real reason they're always at each other's throats. Notable because a) he hadn't even realized he knew until he said it and b) he made Morrolan look sheepish and Aliera blush. He made Aliera blush.
Harry and Murphy in The Dresden Files are a relatively dark version (neither particularly trusts the other) for the first three books in particular. Then there is Character Development, and the two are a lighter version thereafter.
Both are also very interested in each other.
Harry and Carlos also tend to fire friendly insults back and forth, though without the undertones Harry and Murphy have. Their jabs tend to revolve around Harry being significantly older and Carlos being a virgin.
Ebenezer McCoy and Joseph Listens-To-Wind have a similar dynamic. Ebenezer consistently refers to Listens-To-Wind as "Injun Joe", while Listens-To-Wind laments that "the old hillbilly is too backwards to know it's Native American Joe nowadays". However, in spite of the constant bickering, their relationship is good, and they form the core of the White Council's anti-establishment bloc.
Elsabeth Soesten and Brother Hieronymus are constantly sniping at and insulting each other. The very first scene of No Good Deed... has Elsabeth and Hieronymus yelling at each other over the predicament they're currently in, which is only mostly to get the outlaws surrounding them to let down their guard enough so the pair can take them unawares.
The title character of the Fred the Mermaid trilogy by MaryJanice Davidson has this relationship with all her friends but with her best friend Jonah it gets Turned Up to Eleven. It's a rare day when at least one of them doesn't threaten to kill the other.
Dragon Gloom and monster hunter Veres bicker and snark at each other all the time, but they genuinely like each other and it's implied that for both of them, the other is the only true friend.
As the story progresses, Veres and werewolf Shelena, his so-called enemy, slowly morph into friends as well, and then go even further, with the way their conversations go never changing from the Snark-to-Snark Combat they started with.
Veres and the elven archmage Morriel engage in mutual underhanded insults as soon as an opportunity arrises. Turns out they used to be best buds while they studied together at the Mage Academy and remain close friends even after Veres' exile. Shelena at one point strongly suspects that some of the elaborate insults flying back and forth are to drive her away and get some bro time but decides to be an annoyance and stays.
Cinder and Thorne of Lunar Chronicles - after breaking out of prison together and bickering nonstop for several days, they have this relationship to a T.
The Malazan Book of the Fallen series has Quick Ben and Kalam. Kalam goes so far as to threaten (and they try) to throttle Quick Ben, calling him all sorts of names, while Quick Ben just cannot pass up an opportunity to be a Smug Snake and provoke Kalam. They're each other's oldest and closest friend, though, so beware anyone who even looks at one of them funny.
Shakespeare: for one excellent scene in Much Ado About Nothing, Benedick has been tricked into thinking that Beatrice (with whom he has a Slap-Slap-Kiss relationship) is secretly pining away for him... she shows up and insults him as she always does, but as soon as she leaves he begins analyzing their conversation, interpreting every line as a secret declaration of love. Notable for the line, "There's a double meaning in that!"
Subverted, after a fashion, in that Beatrice really is pining away for Benedick but won't admit it to herself. The first question she asks of Don Pedro's messenger is whether he has had any news of "Signior Mountanto," whom she proceeds to mock, telegraphing her real feelings to the audience.
Shadows Of Self (second book of Wax and Wayne): Steris and Wayne have taken to insulting each other in a friendly manner. It's not clear if they're friends that don't actually like each other, or enemies that kind of like each other.
Doctor Watson and Sherlock Holmes. Holmes pokes fun at Watson's writing, Watson complains about things like the use of a gun indoors, the constant chemical odor, and the fact that his roommate won't clean up after himself, but when Holmes is in Europe and sick it's Watson who comes for him and when Watson's been shot it's Holmes giving the assailant death threats, which proves the guy who shot him was an idiot. Also, even before that, Holmes pistol whipped the assailant, and rummaged through Evans for more weapons that would most likely either endanger or worse, kill his best friend. He even genuinely guided him to a chair and begged (in God's name, mind you) for Watson NOT to be hurt.
Givenar and Antinas, Those Two Guys of Space Marine Battles, love to sling insults at each other and banter all the time, but you can see clearly that they're best friends.
The Spirit Thief: Josef and Eli have dramatically opposing personalities, mock each other a lot and come to blows over plans and each other's behaviour disturbingly often, but they're also undyingly loyal to one another and both know that if push comes to shove, they can always count on each other.
Historically, the Seven Kingdoms of A Song of Ice and Fire were this writ large. Every megalomaniac who laid eyes upon the bickering people of Westeros and determined that he would bring them to heel with his sword would find aforementioned "bickering" unexpectedly absent. (The only guy who succeeded had three huge dragons to help him out.)
Songs and Swords books by Elaine Cunningham has Danilo Thann and Elaith "The Serpent" Craulnober passing through Worthy Opponent phase to the mix of mutual admiration and annoyance. This strange friendship is interspersed and supplemented with Elaith's acidic sarcasm and Danilo's "innocent" clownade.
Luke and Mara. She stays snarky even after they marry.
Kal Skirata and Walon Vau, in the Republic Commando Series. They've bandied insults, fought each other multiple times, and have actually tried to kill each other at one point—but in the last book, Skirata admits that Vau's like family to him. It's reciprocal.
Anakin and Obi-Wan, especially in works set after Anakin's elevation to Knighthood, such as Labyrinth of Evil.
In the Sword of Truth series, Rachel's adopted father Chase frequently tells her (most affectionately) what an ugly little girl she is, to which her typical response is to burst out into giggles.
Renton and Sick Boy in Trainspotting. In the book, Renton notes that he and Sick Boy started insulting each other in a joking way, but that over time they are starting to really mean it.
In Wolfblade, Torin and Haegr. Their bickering reminds Ragnar of his with Sven.
The Traitor Son Cycle: When not strictly professional, the interactions between Bad Tom and Sauce are filled with thinly-veiled insults and mockery. This being said, they're very good friends, owing largely to the fact that Bad Tom acts like this towards Sauce because he's one of few people who see her as a knight, not a woman.
We Are Legion (We Are Bob): Calvin and Goku, two second-generation clones, are complete opposites and metaphorically snipe at each other all the time, while threatening to literally snipe at each other. They're also inseparable, and insisted on going to Alpha Centauri together.
Wings of Fire: The dragonets (Clay, Tsunami, Glory, Starflight, and Sunny) fight quite a lot in spite of living with each other all their lives. Despite that, though, they always have each other's backs, risking themselves to help each other out.
Sadly averted with their backup replacements Morrowseer picked. They strongly dislike each other, they don't care if one dragonet gets injured, and they pick on Fatespeaker a lot.
Geralt and Dandelion make an unlikely pair of friends in The Witcher. Dandelion annoys Geralt with his near-constant scrounging, his unwanted immortalisation of him in song, and his Casanova-esque lifestyle that often gets them into trouble. Geralt annoys Dandelion with his martial grimness, his dislike of both his profession and his lifestyle, and the fact that he often inadvertently ends up in the midst of monsters, assassins, or even multi-nation wars because of Geralt. But put to the test, ofttimes staring down the shaft of an arrow, or a sword's blade, you'll never find a more loyal duo.
Words of Radiance (second book of The Stormlight Archive): Adolin and Kaladin slowly evolve into this. They start out heavily mistrusting each other—Kaladin thinks Adolin is an arrogant fop, while Adolin thinks Kaladin is an angry little man who is clearly hiding something—but they quickly become closer despite their best efforts. Adolin accidentally confides some worries to Kaladin once or twice, and they have good non-verbal communication skills. After Kaladin helps Adolin beat four Shardbearers at once in the arena, Adolin upgrades him to an actual friend. Kaladin, unfortunately, doesn't notice right away, and it takes Shallan angrily explaining things for him to turn things around.
Pavel and Will from The Year Of Rogue Dragons. Will calls Pavel a charlatan, Pavel tells him "Silence, insect", and both of them constantly insult the other's intelligence. Yet they can always count on each other for anything serious.