To specify I mean pre 1815 firearms.
Now that you have specified it, I am going to tell one such case of urban warfare, my city in 1589.
After the Spanish Armada, the English decided to counterattack, and they did so the very next year. When the English fleet came with the intent of destroying the 100 or so ships that still remained from the Armada, they could not get to Santander, where the Spanish fleet was under repair, so they tried to find another place to invade and where to set a foothold: Coruña, an important port in Galicia, but with relatively few people (around 4,000).
The immense English fleet or 180 ships and over 25,000 men came to the city thinking of a quick victory, but reality was very much different. The attacks started with the fleet making it to southeastern bay of Coruña, as the northwestern bay is impossible for large ships (too many rocks). The city was defended by the castles of San Diego (not existing nowadays) and San Antón (currently the Archaeological Museum), from which the defenders started opening fire, trying to prevent the fleet from disembarking. The guns from the ramparts were also firing against the English ships, but all of the gunnery fire could not repeal the attack, and the English made its way to the quarter known as Pescadería (the Fishermen's quarter, today city centre).
The city's militia fought street by street, profiting from the knowledge of the terrain, setting up ambushes as best as they could in order to protect the civilians, who managed to seek refuge in the city itself, that had strong walls (today known as the old town). The militia suffered heavy losses, but gained the civilians all the time they could to get intra muros. Then, the militia followed suit and regrouped inside the ramparts. They numbered no more than 1,200 and were led by Juan Varela. The actual soldiers were but another 1,000, commanded by the marquess of Cerralbo, and 150 veteran arquebusiers by Álvaro Troncoso de Ulloa.
Throughout the next days, and for a couple of weeks, the militias and the troops organised sorties and encamisadas in order to cause damages to the English while minimising the losses. They were relatively succesful, but working on borrowed time, hoping for the actual army to eventually appear and rid them of the English invaders. Time and time again they kept harming the English, but being so completely outnumbered, they could only wait and hope for the best.
Meanwhile, the English started building a tunnel for a mine with which they would demolish a part of the ramparts and start the assault, with that and sheer numbers, that city should fall within no time. The troops prepared for the assault. The mine was set on fire, but the tunnel had been slightly too long and the gunpowder too much, causing the ramparts to blow up outwards, burying 400 Englishmen in the process. Light loss, but still bad. The city's militias kept the attackers at bay for as long as they could, while the troops commanded by Cerralbo skirmished as best as they could from the Pescadería, causing losses in the English rearguard. All of the fighting men of the militia were killed.
Then came the assault. The English entered through the breach in the ramparts only to find corpses and no fighting men. When they entered the city, they started being attacked from the houses, with the women from Coruña throwing pots, rocks, scissors, tiles, and everything with which they could kill the English. The situation turned completely nasty for the English, as they were fighting the strongest force Nature has: mothers protecting their children.
The women of Coruña started fighting street by street, hiding behind corners with knives on their hands, while Cerralbo's troops attacked the Englishmen from behind. If one person distinguished herself during those dark hours, it was María Pita, whose husband Gregorio Rocamunde had died during the siege, being of the militiamen. She led the women during that hard time. During the English assault, she had killed one of the English ensigns, taking the banner as prize.
With the urban guerrilla, the sorties led by the militias, and the attacks on the rear by Cerralbo, the attack was repealed, causing enormous losses to the English. Between those who deserted, and those who died, the English casualties numbered around 12,000. Coruña suffered enormously too, losing more than 1,500 people in a siege that put the city to its limit, and that was finally won by women.
María Pita became a larger than life figure and a folk hero in Coruña, obtaining from the King the rank and pay of an ensign, a yearly pension, and a royal privilege for exporting mules to Portugal. Today, the main square is named María Pita Square, one of the adjacent streets is named Marqués de Cerralbo, and another one is Capitán Troncoso, and another important street is Capitán Juan Varela.
The Third Punic War featured pretty intense fighting in the city of Carthage
In 151 BC the 50 year annual indemnity imposed on Carthage at the conclusion of the Second Punic War was over. However, certain Roman senators like Cato the Elder had deep antipathy for Carthage as made famous by a supposed phrase he uttered to end his speeches (Carthago delenda est, Carthage must be destroyed). In the end the Roman Senators voted to go to war with Carthage
The siege started in 149BC, the Romans had made some successes in storming Carthage such as conquering a nearby quay and had also entered part of the city at some point. In 146 BC small party of Romans led by Caius Laelius were able to slip into Carthage and seize the inner naval harbour, and pushed forward into the Agora. In the morning the main commander Scipio Aemilianus (adopted grandson of Scipio Africanus) led 4000 troops into the city and with the frustration felt from the lengthy siege the legionnaires immediately looted the Temple of Apollo.
According to Appian, three streets (about 7m width from excavations) led from the Agora to the Byrsa (the inner citadel of Carthage) flanked on each side by tall buildings each six stories high, it also contained several side streets each of roughly 5m width. The men who had just plundered the Temple attacked but a slew of missiles from said buildings stopped them. The legionnaires unable to progress attacked some of the buildings and slowly went floor to floor. When they had reached the top, they laid planks of wood from the roof of a building to the adjacent one.
As they continued to subdue the buildings the assaulting Romans on the streets were able to move further and this is where they fought the bulwark of the Carthaginian army. As the norm with street battles high causalities were inflicted on both sides. The Romans with their tactical use of feeding fresh reserves in, being in better physical health (The Carthaginians as usual with defending parties in sieges were incredibly malnourished) they slowly made their way towards the Byrsa and reached it.
Though Appian said the streets were wide they were not wide enough to accommodate the Roman war machines needed to destroy the wall of the Byrsa. Scipio ordered all of the buildings to be destroyed and a new wider road paved. Appian, probably borrowed by Polybius' eyewitness description, gives a vivid account of the road's creation. Scipio wanted the road built very urgently and as such with such little time to sort the rubble, corpses and the injured were built into the road itself. Human bones were actually found in the ruins of area of Carthage where the road was built, lending credence to the claim. After six days the road was completed and the Romans were ready to destroy the walls of the Brysa.
However, the Carthaginians sent a delegation carrying olive branches and promised to surrender if Scipio spared their lives. 50,000 men, women and children remained in the Byrsa and were sold into a life of slavery. Hasdrubal, his family and about 900 Roman/Italian deserters remained and had barricaded themselves in the inaccessible Temple of Aesculapius. They committed suicide by setting the Temple on fire and perishing in the flames. Carthage was destroyed and a new Roman Carthage was later developed on the same area by Julius Caesar from 49-44BC and at one point was the 4th largest city in the Roman Empire.
The Romans started the war with an army estimated to range from 40,000-50,00, of which 17,000 were killed. Carthage of course suffered the most. It had started the war with a population 200,000-400,000 and at least 150,000 perished during the Third Punic War. I am not sure how much of each army suffered from the actual urban battle of Carthage, but as said street battles tended to be very violent affairs.
In the December of 1835, the Texas Revolutionaries stormed into San Antonio after a two week siege of the town and the Alamo. At the time, Mexican General Martin Perfecto de Cos held the city and fortress with at least 500-700 men and several pieces of artillery.
The Texans, numbering around the same amount, couldn’t make a straight forward offensive into San Antonio because Cos had arranged the artillery to block off the streets. Therefore, the Texas Revolutionaries began breaking through the walls of houses and getting to rooftops to start picking off the gunners from the flanks.
It didn’t take long for the Mexican officers to figure out what the Texans were doing. So, they started sending their troops into strategically located houses and establishments to catch the Texans off guard.
In one instance, the Texans and Mexicans were literally one thin wall away from each other and were knocking out small pieces of the wall to take pop shots at each other. The Texans were eventually able to get onto the roof of the building and broke in from the top. The Mexicans were forced to retreat out of the building.
The 1835 Texian assault on San Antonio is classified as one of the first instances of urban warfare in American History. Of course, when the Mexicans returned to San Antonio the following spring, the final assault on the Alamo on March 6, 1836 consisted of small scale urban warfare when the Mexican forces started rushing into the fort itself. The Texans, particularly the New Orleans Greys, fought back by forcing the Mexicans to come charging straight into the room the Greys had set up as a defensive line.
For a good source on the 1835 siege and capture of San Antonio, check out Stephen Hardin’s “Texian Iliad”.