Gilderoy Lockhart in Harry Potter and the Chamber of Secrets. Of course, it could just be an act designed to keep his fraudulent reputation afloat. His vanity about his physical appearance is almost certainly genuine, though. J. K. Rowling has admitted that Lockhart is one of the few characters in the series explicitly based on a real person. While refusing for obvious reasons to reveal that person's identity, Rowling has said he was actually even worse than his fictional counterpart and suggested that he's out there now claiming to be the inspiration for Dumbledore, or that he wrote the books himself and just let her take the credit out of the goodness of his heart.
However, the one thing Lockhart is good at, Memory Charms, is something he is very good at. He's also pretty good at locating people with stories of interesting magical exploits. He's just not good at any of the things he actually claims to be good at.
As his actor, Kenneth Branagh, put it, Lockhart "feels himself to be terrifically important, thinks of himself also as being terrifically modest. He is neither of those things."
Cersei Lannister in A Song of Ice and Fire is a rare female example. She believes herself to be, among other things, clever, ruthless, and irresistible to men. Of those qualities, only 1.5 are true. Unfortunately, she's the Queen of Westeros, leading to some problems in her reign.
X-Wing Series. A character who was never seen while alive, Captain Darillian. He was "a petty guy who reached his ultimate level of usefulness driving a minelaying barge for a warlord and then had to be scraped off the floor," but his ego was big enough that he kept a Captain's Log in full holo and talked into it like he was always on dangerous missions that the fate of his sect of the Empire rode upon.
His boss, Admiral Apwar Trigit, was also an example, albeit a much quieter one. He fell for every single trick the Wraiths set up. Aaron Allstonaddressed why in his FAQ.
Because he's not as bright as he thinks he is. He's creative in certain intelligence-gathering functions, but that has led him to believe that he is brilliant at everything. It's this assumption of his own infallibility that leads him into several errors.
And then we have Trigit's boss, Warlord Zsinj - although with Zsinj, it's a form of Obfuscating Stupidity which he knows a lot of people can see through. He's certainly got an ego, but it's not as unrestrained as it seems.
In the second novel, there is the "commanding officer" of a crew of repair technicians on a fully automated power relay station who takes his job way to seriously. When the Alliance invasion fleet appears in orbit and the power relay network gets hijacked by Alliance commandos, he tries to rally his crew to join the defense of their homeworld, until they explain to him that there is nothing they can do to shut down the station and that it doesn't have any kind of weapons, and he should just relax and join their card game.
All the other Clans seem to believe Firestar is this due to his tendencies to try and talk things out instead of fighting and the fact that he's helped each Clan in the past; the other leaders consider him arrogant.
In Bluestar's Prophecy, Thistleclaw and Oakheart are both said to be arrogant pricks.
Discworld's Lord Rust believes himself to be a fine military commander despite ignoring such factors as provisions, location, and the respective size and experience of forces. When justifying his tactical decisions he frequently cites battles when the people in that scenario lost, or on a couple of occasions, were nursery stories.
General Ashal: I believe the motto of his old school was "It matters not that you won or lost, but that you took part."
Prince Cadram: And, knowing this, his men still follow him?
High Lord Weiramon from Robert Jordan's The Wheel of Time novels. He thinks he's charming, witty, the perfect general, and a clever enough liar to make the protagonist think he's totally loyal to the cause. He's actually so unbelievably suicidally stupid that some fans think he's actually The Mole, sabotaging the goodies from within by "accidentally" screwing everything up.
The latest book shows that he is indeed a mole, just not for the Seanchan. And Rand was really disappointed about it too.
Zaphod Beeblebrox from The Hitchhiker's Guide to the Galaxy, who's actually a pretty big name (he became President of the Galaxy because he wanted to steal a ship, created the most potent alcoholic drink in the universe(s), then saved the universe a few times. Mostly while drunk) with a truly colossal ego:
If there's anything more important than my ego on board this ship, I want it caught and shot!
Remember that this was in a fake universe which was created specifically with him in mind, so in there he was the most important person in the universe.
Diary Of A Madman's Poprishchin, the eponymous madman, believes himself to be an important person, that his holding an unimportant position at age 40 is non-indicative of his career, and those trying to dissuade him from pursuing the director's daughter are just envious.
Jane Austen uses this trope a lot. Several characters in Pride and Prejudice alone qualify: Lady Catherine, for example, is not always treated with the automatic reverence which she seems to expect (except by Mr. Collins, who also qualifies for this trope). Mary expects that everyone will want to hear her sing and know her opinion about every subject, but she's treated as just as silly as her younger sisters. Darcy at first appears to be a Subversion of the trope (since he has close friends even if his casual acquaintances think he's full of it), but we later found out he's not as conceited as he first appears to be.
Adrian Mole believes he is a gifted author and celebrity chef. In reality his unpublished work is terrible, his only published book was written in his name by his mother, and he was once the presenter of a low-budget cable show about how to cook offal. All of this goes right over his head as he tries to use his "celebrity" status to his advantage; and frequently writes to people who are actually famous to ask for favours (such as to speak for free at the Christmas dinner for his book club), ask for his own show on radio, or to offer insulting suggestions about their lifestyles.
The Magic School Bus In The Ocean features a character named Lenny the Lifeguard, a good-natured but somewhat arrogant lifeguard at the beach, who is first seen showing other beach goers pictures from his 'daring rescues' (Which, judging from the pics, weren't that daring). He ends up The Drag Along when he sees Ms. Frizzle drive her bus into the ocean, getting swept up in the class' latest field trip. Throughout the story, he tries to maintain an air of authority, despite being pretty much redundant. Once the madness ends, he is elated to have 'saved a whole class'.
Lorenzo Smythe, the main character of the Robert A. Heinlein novel Double Star. While he is a very good actor (enough that the Emperor says that he's Smythe's biggest fan), he considers himself to be an artist par excellence, and the standard by which all other actors should be judged. He prefers to refer to himself as "The Great Lorenzo." When he goes missing, not even his agent notices for a long time. His obituary only mentions that he hadn't had a job in months, and that he was likely Driven to Suicide by depression.
In The Tower of Geburah by John White, we have Theophilus, a flying horse with an ego the size of a small mountain. Among his claims are that Gaal -the Jesus-allegory of that fictional universe- often consults him for advice. Theophilus' arrogance nearly gets the female primary and secondary leads killed when he deviates from the flight path Gaal told him follow, causing the three to be out after sunset. (Until the Big Bad is defeated, flying after sundown is freaking dangerous.)
Dead Famous by Ben Elton has a few examples of the trope. Layla believes she is smarter and more attractive than the other House Arrest contestants; but is the first to be voted off the show because the others hated her. She also describes herself as a fashion designer but is just a shop assistant. David proclaims himself to be an incredibly gifted actor, to the point of hypocritically berating Kelly for "prostituting" her talent by appearing as a movie extra; but in reality his career is going nowhere and he lives off his earnings as a porn star. Geraldine thinks that Kelly herself is this, and thus resolves to destroy Kelly's public image through Manipulative Editing.