Tony Starkis this trope IN A CAVE! WITH A BOX OF SCRAPS!!! This applies to both his comics incarnation as well as how he's treated in films. Notably, he only really developed the heart of gold after the accident that made him Iron Man; before that, it was in there somewhere, but not so you'd notice.
Green Lantern Guy Gardner. Rowdy, egotistical, self-centered, boisterous, loudmouthed, short on impulse control and long on bravado. However, his side of the Slap Slap Kiss relationship between him and teammate Ice is genuinely tender and sensitive, a fact that Ice's friend Fire flat out refuses to believe. Additionally, originally he consciously put on his tough guy facade to cope with being The Unfavorite with an overachieving big brother.
And underneath his bad attitude is a true hero, a man willing to fight and die to protect the universe from harm and deemed best suited to lead the GL Corps as the #1 Lantern.
It's worth noting that he was on the list of "best dudes on Earth" to wear the ring when the Earth lanterns were being chosen. That alone means he's a genuinely deep, heroic guy inside... he just happens to be kind of a douche outside.
To expand: GL rings are powered by courage and willpower, basically strength of character, so for a person to be on the list at all means they're basically good people, de facto. This is why some fans believe Batman would make a potent Green Lantern.
It's also worth noting that Abin Sur's ring would probably have gone straight to Guy in the first place, had he just been closer than Hal Jordan.
In his early, pre-Green Lantern days he was a kindergarten teacher. Hal had to save him when he hurt himself rescuing a busload of his students he was taking on a field trip.
The bus rescue happened at the beginning of the issue that introduced John Stewart in 1971, the Jerkass persona came about later with the Crisis on Infinite Earths in 1985. It was apparently attributed to brain damage caused by his many misfortunes in the previous decade or so, starting with the injury he suffered at the aforementioned bus rescue when the bus fell on him and culminating with a few years in a coma before the Guardians revived him.
John Stewart was a bit of a jerk as an Angry Black Man in his first story. He was belligerent enough for Hal Jordan to question the Guardians' judgement about having him recruited as his new backup. However, Stewart quickly proves himself and Jordan happily concedes at the end of the story that while Stewart's outspoken style might be off-putting, he's still an excellent recruit.
The snarky outcast drow rogue Downer, from the comics Downer: Wandering Monster and Downer: Fool's Errand by Kyle Stanley Hunter (formerly published in DUNGEON Magazine). A down on his luck "proven loser" who survives by his wit, quick tongue, quick blade and quick reflexes (and mainly by running the hell away when outnumbered, unless he's sufficiently pissed off that he decides to indulge his inner Badass and take on a whole bunch of enemies by himself). Although he considers himself an "evil bastard" who puts his own survival first and claims he's "always prepared to be screwed over by his friends", Downer has demonstrated amazing loyalty to friends and guild mates on several occasions, and he always pays back his debts. Downer's brother Aristide claims Downer is a "jerk", but then, Aristide is more of a typical drow (read: selfish and cruel) and his viewpoint is questionable.
This is a frequent characterization of Wolverine from X-Men.
Northstar tends to be something of an acerbic arrogant bitch to everyone around him... except his Tennessee Williams-style mentally ill sister (well, most of the time, anyway) and especially his deceased adopted infant daughter, Joanne Beaubier.
In his more darker characterization Cyclops is this. In recent times he formed a hit squad of the more sociopathic members of the X-Men to kill the X-Men's greatest enemies. Before that he had a psychic affair on his wife who died later (Thought he was going through a deep emotional breakdown and he was manipulated into doing so) and before that abandoned his wife and son to go to his ex girlfriend (but at the same time he was emotionally conflicted, tried to make it up and felt really guilty afterwards as well as possibly being manipulated into doing that as well). However, he only formed the Hit squad in the first place to protect mutants from their most dangerous enemies while they were on the verge of extinction where all it would take is the slightest super weapon to destroy them. In Deadpool X Marks The Spot he sends Wolverine to kill Deadpool, but only because he risked making the X-Men look like monsters and earlier comforted Murcury when her father was being a dick. And while he at times is displayed as a cold emotionless leader, he was visibly upset when Thunderbird (A real Jerkass) died despite him being powerless to stop it from happening, as well as feeling guilty that he allowed Kitty to get trapped in her ghost state/a giant bullet.
Emma Frost also tends to be this. Despite of being the bitch that she is, she cares about the mutant race, her friends, her students and Cyclops.
J. Jonah Jameson from the Spider-Man comics is another good example. Sure, he's short-tempered, tight-fisted, and an often obnoxious loudmouth, but he's also been shown as a tireless crusader supporting everything from labor union rights to mutant rights, going after organized crime figures and corrupt politicians despite repeated attempts on his life, and discreetly supporting various charities and social projects, and even hiring a good lawyer for Peter Parker when Parker was falsely accused of murder.
In the recent arc where Spider-Man publicly unmasked himself as Peter Parker, Jameson went so far as to refer to Parker as being like a son to him, and that he had always regarded Parker as the "last honest guy in town". What does Jameson do next? Turns around and sues the crap out of Parker for misrepresentation.
Of course, to be fair, he wasn't entirely unjustified in doing this; he was also later confronted by other characters about how much of a jerk he'd been to Spider-Man / Peter over the years.
It should also be noted that Jameson's character is interpreted drastically differently, Depending on the Writer. Some writers really tend to push the "heart of gold" aspect, whereas others still prefer to present him as a genuine Jerkass, ignoring any character development to the contrary by other writers. (This usually coincides with alternating interpretations of Jameson as a genuinely competent newspaper publisher and an angry tabloid publisher with an agenda. The latter version is occasionally characterized as clueless and outright sociopathic, too, whereas the former version sometimes borders on hidden philanthropist. It's really inconsistent, to say the least.)
It should be noted that during Stan Lee's run on Spider-Man Jameson is always a JerkassScrooge who feels that appearing to have a heart of gold is the best way to make money.
Mainly though, the character seems to be kind of like Spider from Transmetropolitan. He's a complete asswipe, no doubt, but he surely is also a kind person at heart and has shown this on several occasions. For example he genuinely cares about honesty, integrity and civil liberties and can be quite nice (or at least, less caustic) to his friends, like Peter or his employees, despite being a sarcastic jerk.
JJ was once offered a deal: if he stopped bashing Spidey every time he needed an editorial, he'd get an exclusivity deal with the New Avengers. He even got to hear Captain Fucking America tell him Spidey was a hero rather than a monster. His response? After shaking hands on the deal, he promptly went back to not only committing libel, but making accusations of bribery and digging up things like "wanted murderer" (Wolverine), "terrorist" (Spider-Woman) and "convicted drug dealer" (Luke Cage, who was framed and exonerated).
These inconsistencies are avoid by the Ultimate Universe J. Jonah Jameson (probably because the only writer was Bendis). He embodies this trope completely. Three examples stick out - firstly, after firing Peter in a temper tantrum, he comes to the kid's house and opens up to him about his son dying, before offering to give him his job back and allowing him to start shadowing Ben Urich so he can get a taste for real journalism. The second is him doing a Heel Face Turn on the whole Spider-Man thing after the Ultimatum arc when it's not certain if Spidey survived, and writing a heartfelt public apology/obituary for the webslinger. Lastly, he eventually discovers Peter's secret identity and his first reaction is to offer him money. He says he'll pay for Parker's entire college education on the basis that "I'm a rich man, I'd hardly notice."
In Spider Man 3, Eddie Brock gets exposed for photoshopping pictures to make Spider-Man look like a criminal. He tries to defend himself by pointing out that Jameson's been railing against Spidey for years. JJ responds that while that's true, and he still thinks Spider-Man's a crook, he would never make up "proof" like that. He then immediately fires Brock and issues a retraction and apology for the story that used the doctored image.
In DC vs. Marvel, when it looks like The End of the World as We Know It, Spidey asks Jameson if he has any last digs to get in. Jonah responds "For what it's worth, I'm sorry", to which Peter can only say a quiet "Oh."
Raphael from the Teenage Mutant Ninja Turtles in a few comics, and also more than just the comics as the first couple of films, the new animated series, and the most recent CGI film have shown.
Scrooge McDuck, who pretends to be more of a jerk than he really is. On the rare occasion that he has a genuine charitable impulse, he attempts to hide it from everybody.
Gennosuke from Usagi Yojimbo, who is, in the title character's words, "a money-loving cheat" who has managed to swindle Usagi more than once. Still, he's done several acts out of the goodness of his heart, which upsets him to no end when Usagi compliments him on it.
The same applies to Gen's fellow Bounty Hunter and occasional partner Stray Dog, who shows every sign of being a ruthless, cheating Jerkass until we learn that he donates the lion's share of his profits to an orphanage.
Constantine is generally only nice when it suits him, but seems to have a soft spot when it comes to spirits with a sob story or keeping the world from getting destroyed.
Spider Jerusalem from Transmetropolitan is a huge jerk, but he does have a heart of gold. He stands for truth and justice, he's just an ass while doing it, and has done something so small and good-hearted as comforting a lost little child and buying her pawned doll back for her.
Flash Forward, a.k.a. "Negative Man" from the Doom Patrol. An irreverent smartass who never has a nice thing to say about anyone, he has a soft spot for introverted teammate Ava and often seems like the only person who cares about her, and vice versa.
Although the original and current versions were straight-up Deadpan Snarker.
Robotman, also from the Doom Patrol (though he doesn't technically have a heart: or if he does, it's made of some other metal).
Even in his darkest iterations, Batman does what he does so that one day, there'll never be another little boy forced to watch his parents get killed in the street.
Also, Damian Wayne, Batman's son. In Batman #666, as a Future Badass, he is shown having a pet cat he named Alfred. And in canon, he was visibly disgusted and threw up when he saw hundreds of dead bodies of children.
Also from canon, we found out he has been visiting Hush (who had surgery to make him look like Bruce Wayne), who was imprisoned in the Wayne Tower, and playing chess with him. Hush suspects that he does this because Damian is grieving for his father and it's a way for him to spend some time with his father.
Jason Todd, despite the things he's done and the murders he's committed, takes in Sasha, a young girl whose face was mutilated by villain Professor Pyg. When she feared that the mask that Pyg had stuck to her face would make it that no doctor could fix it, he assured her that it wouldn't make her any less special.
Poison Ivy as well. Despite being a fanatical ecoterrorist who gets entertainment out of throwing living people to giant flesh eating plants, she deeply cares about her friend Harley Quinn, and has been a jealously protective and loving Mama Bear to the stray children who fell under her care while Gotham City was ravaged by an earthquake.
Jed Poole from Star Raiders yells bombastic insults at anyone within earshot, but he won't hesitate to leap into action if any of his companions are in danger. Though there are still times that she acts like a Complete Monster.
Woody (of Quantum and Woody) won't pass any opportunity to deflate his friend's wild theories and excessive idealism, but he won't hesitate to help when the chips are down.
Lois Lane. She's gruff, hard-nosed, sharp-tongued, quick-tempered, bossy, rude, and more than a little bullying; but she's deeply compassionate, has unshakable integrity, is fiercely loyal to her friends and husband, and loves her job because it allows her to help people and fight for truth, justice, and the American Way. And kind, laid-back Clark Kent's attraction to her has strong (though gender-flipped) All Girls Want Bad Boys vibes.
While Bucky of Get Fuzzy is mostly a self-centered Jerkass, he's been shown to have shades of this on at least 2 occasions.
In a relatively early arc, when Satchel's arm is badly hurt while chasing a bike, Bucky shows an unusual (for him) amount of care and concern, such as being the one to first inform Rob of the accident and clearly being close to panicking while doing so. Near the end of the arc, Satchel realizes that he lost his beloved wristwatch in the accident, and Rob muses on how it's likely impossible to find it now. Cue a scene of Buckey fishing the watch out of a drainage ditch, out of his own volition.
In a later arc, in the wake of 9/11, Rob and Satchel decide to donate blood. The last strip of the arc is a single panel showing Bucky setting up a bunch of signs congratulating them on their blood donations and calling them heroes, and even prepared a batch of cookies for them.
Rat from Pearls Before Swine qualifies as this sometimes, though the more sociopathic side of his personality tends to be emphasized. One time Pig jumped off a roof believing he could fly (It Makes Sense in Context) and, after waking up in the hospital asked Rat what happened. Rat begins to tell him the truth, but then pauses and says instead that Pig hit his head on the moon.
Hunter Hastings (protagonist of independent comic Druid City) falls into this trope for much of the planned series. While his ulterior motives are not altruistic, his actions end up benefiting his community.
Ignatz Mouse from Krazy Kat--he may constantly throw bricks at the title character's head, but he's been shown to genuinely care about his Friendly Enemy, and he even does the occasional good deed.