Code Geass: In season two the Black Knights take refuge in the Chinese Embassy in Tokyo, and even claim one of the embassy's rooms as their sovereign territory. The embassy's smack dab in the middle of territory controlled by the vastly, vastly superior Brittanian military; the only reason Brittania doesn't just attack the Black Knights is because invading a foreign embassy is enough of a diplomatic faux pas that it'd probably just start another war. Bit of an unusual example, though, in that the Black Knights can apparently escape unnoticed any time they wish, but prefer to keep the Brittanians distracted by the embassy for as long as possible.
One takes place during episodes 16-18 of Tears to Tiara, when Gaius of the Divine Empire tries to take Avalon, where the demon king Arawn is at.
Of course, Siege is about a siege. Asgard, the city of the gods, is under siege by the Dark Avengers, H.A.M.M.E.R. and an army of superheroes of the 50 states initiative. Then The Cavalry (the good Avengers, and Patriot) shows up, but Asgard was destroyed by Sentry.
John Woo's The Killer features one of these as its final shootout, with the title character and his Cowboy Cop ally defending the Killer's last place of sanctuary, a church, against a virtual army of assassins sent by his ex-boss to murder them all.
Scarface ends with a siege by assassins working for Alejandro Sosa against Tony Montana's mansion, which doesn't really get going until Tony takes up an M-16 with a grenade launcher with a cry of "Say hello to my little friend!"
The Siege, usually involving a Town Boss being held in a city jail, was the climactic event of four John Wayne movies, including Rio Bravo, El Dorado, The Sons of Katie Elder, and Rio Lobo. Apparently Duke liked this story line even more than he liked stalking and spanking beautiful women (three different movies!).
Defied in Pirates of the Caribbean: At World's End. Several of the pirate lords advocate hiding in their fortress when the East India Company comes calling; said fort is supplied for a several-month siege. Jack points out that they could do that, but half the fort's inhabitants would be dead in a weak due to cabin fever-induced civil war.
The Silmarillion features the Siege of Gondolin, except unlike the above examples, Morgoth's forces succeed in taking the city, with only a remnant of its population escaping.
Also shows up in The Hobbit when Thorin and his band are holed up inside the Lonely Mountain as the armies of Laketown and the Wood Elves try to get in to claim the treasure.
Dan Abnett's entire Warhammer 40000: Gaunt's Ghosts novel Necropolis is one prolonged siege battle, with the Chaos-corrupted hive city Ferrozoica hurling their entire population at the much larger but much less-militarized hive city Vervunhive. Think Minas Tirith, but with tanks and a good hundred times the manpower. It occurs again in Sabbat Martyr, with Gaunt explicitly comparing and contrasting the two situations, noting that this second time around the "good guys" were even worse off.
Also in the game background the Ultramarines' defence of their polar fortress againt the Tyranids that had invaded their home planet. Most of their 1st company died holding the place untill the Imperial Navy could drive off the Hive Fleet by having a battleship perform a Heroic Sacrifice and explode it's warp core right in the middle of the fleet.
Noticeably averted in War and Peace. Kutuzov abandons Moscow despite everyone on his staff and his emperor demanding that he hold Moscow against a siege.
A mainstay of Henryk Sienkiewicz's ''Trilogy'', set in the 17th century Polish-Lithuanian Commonwealth. Each of the books in the trilogy has a climactic siege featuring the defenders fighting against great odds.
Rogue Male: for a large part of the story, the hero is besieged alone in his hideout, which has gone from a refuge to a hellish trap.
The climax of the entire Harry Potter series takes place in the last third or so of Deathly Hallows, when Voldemort and his Death Eaters storm Hogwarts itself.
The entire premise of Legend by David Gemmell: the garrison of the fortress of Dros Delnoch must hold on against the Nadir army to buy enough time for their country to levee an army. Most of Gemmel's books will end with The Siege and/or Last Stand
In the book Azincourt by Bernard Cornwell it goes into great detail over the siege of Harfleur. The siege is a shambles, the British end up with dysentery, the French keep rebuilding the walls and to top it all a ship gets past the blockade to resupply them. When King Henry V finally takes the small town he lost so many forces he can't possibly hope to defeat the French in open battle but to save face forces his men to march around France attempting to avoid their army...that doesn't work out so well.
Colas Breugnon has a siege described early in the novel. Even though a few people die, both sides come to an agreement after a few days and settle down to eat together. No one's very sore about the entire incident.
In Mistborn: The Well of Ascension the protagonists are besieged in Luthadel by three armies at once; the fact that the besieging armies are all working against each other is the only reason Luthadel lasts so long.
In Mistborn: The Hero of Ages, the good guys are the ones doing the besieging, until the Big Bad's army shows up and the besiegers and the besieged decide to team up.
Defied in the first book of The Deed Of Paksenarrion. Paks's unit is holding a fortress when another mercenary company shows up with siege engines. Paks's unit is not equipped or supplied for a siege (and the other side is a sometimes-allied business competitor, not some Army of Evil), so they surrender.
The main conflict in Redwall is a siege laid upon Redwall Abbey by a vicious one-eyed rat named Cluney the Scourge. Cluney's forces actually manage to get in and have to be thrashed afterwards.
There are many, many other sieges in the series, either against Redwall or the Badger Lord's fortress of Salamandastron.
Part of the plot of Septimus Heap: Darke involves the Siege of the Wizard Tower by the Darke Domaine.
There are many sieges in A Song of Ice and Fire. One siege at Riverrun is entirely at a stalemate until Jaime comes and dissolves the whole mess. Daenerys becomes fairly well acquainted with sieges throughout Slaver's Bay, having been on both sides of them. One of the most memorable sieges in the series is in the back story, the famous Siege of Storm's End in which Stannis' men were nearly dying of starvation toward the end. This gave Davos his opportunity to become a main character by smuggling onions into the castle.
The first series of the revival ended with a Siege, though it was slightly subverted in that the good guys did not actually end up holding off the evil Daleks, and by the end of the episode, every main and minor character, with the exception of Rose Tyler, was dead. Two getbetter.
"The Base Under Siege" is a standard Doctor Who plot ("Moon base, sea base, space base, they build these things out of kits!"), especially in Pat Troughton stories, such as "The Wheel in Space"
"The Waters of Mars" subverts a number of conventions in this regard.
Happens in Neverwinter Nights 2 when the hero's castle is besieged by the undead army of the King of Shadows. The already problematic odds take a turn for the worse when one of the hero's companions turns out to have betrayed them by sabotaging the gate and when the undead, including the vampires, turn out to be unaffected by sunlight.
Mass Effect 2: Garrus' recruitment mission and Grunt's loyalty mission both consist of three or four heroes holding a somewhat defensible position against a horde of mercenaries/alien monsters, followed by a Background Boss. Legion's loyalty mission is a sort-of Tower Defense scenario.
Urban Dead: The game revolves around humans building barricades inside buildings and zombies trying to break in. Most famous is probably Second Siege of Caiger Mall, going for three real life months.
Goblin sieges in Dwarf Fortress; more rarely, human and elven sieges. If all the resources you rely on are subterranean (water, magma, farmlands, wood, ores,) a virulent forgotten beast can effect a siege from below.
In the PS3 and 360 versions of the first The Godfather game, a slew of Cuneos assault the Corleone compound, and your job is to hold the fort with your fellow mobsters. These become more common in the sequel since enemies can now randomly raid your fronts.
Happens to your castle at the end of Dragon Age: Origins – Awakening. Depending on your administrative decisions during the campaign, if you stay to protect the city instead of returning to defend the castle, it can be either a Last Stand for the defenders, or a successful repulse of the siege.
Crossed with Delaying Action in the third Terran mission of Starcraft: you have to hold your fort against repeated Zerg attacks until dropships arrive to evacuate your troops.
Act III of Diablo III has you defending Bastion Keep in Arreat against a full-on demonic onslaught by the forces of Azmodan.
Happens a lot in pretty much every installment of Fire Emblem, defending for a cetain number of turns in some levels and seizing castles in the seige missions.
In The Order of the Stick, Azure City, a bastion of good partially ruled under the watch of paladins, is attacked by a massive army of hobgoblins led by Redcloak, an evil goblin cleric and Xykon, an evil human lich sorcerer. The protagonists find themselves defending the city alongside the paladins. The good guys actually lose with heavy casualties, including the leader of the protagonists. A very, very long arc was dedicated to the fallout of the battle, including the only recent resurrection of said leader.
This trope is a case of Truth in Television. Sieges have been and remain a common military strategy and a good number of movies and television programs base their siege plots on real life sieges like Leningrad and the Alamo. These are well-remembered by a (defending) nation's population if their people either won the siege by successfully holding their position against an overwhelming enemy OR (more commonly) lost gloriously.
Back in 134 BC, the Iberian hillfort of Numantia, in today's Spain, held off a siege by the Roman Army for 13 months. In the end, the surviving defenders chose to suicide rather than be killed or captured by the Romans. To this day, the Spanish language has the adjective/noun numantino, meaning "he who tenaciously resists to the limit, often on precarious conditions."
The fortress of Masada in Israel topped that, holding out against the Romans for three years before choosing mass suicide.
During Spain's War of Independence, the city of Saragossa suffered TWO sieges by the French Army. The first (1808) ended with a Spanish victory; The second one (1809), historically noted for its brutality, ended with a French victory. Saragossa was reduced to 12,000 people from its pre-second siege population of 100,000.
The battle of Alesia was a strange example: Gaius Julius Caesar's army was besieging the city as it was the last stronghold of Vercingetorix (the last Gaulish leader against Rome), but was in turn besieges by a Gaulish relief force. The battle happened when the Gaulish relief force tried to break the Roman siege and the Alesia garrison sortied, but resulted in Caesar beating back the sortie and near-annihilating the relief force (the annihilation wasn't total only because the Romans were too tired to pursue them), causing Vercingetorix to surrender before the Romans broke in and exterminated everyone.
Lasting almost four years, The Siege of Sarajevo was the longest siege in modern warfare. It was part of the breakup of Yugoslavia, and began when, after Bosnia declared independence from Yugoslavia, Serbian forces surrounded the city in an attempt to make a new Bosnian-Serb state, which the Bosnians were none too happy about. The end result was nearly 12,000 dead, and a city forever scarred.