I'm particularly interested in the experiences of infantrymen armed with firearms in urban combat from 17th-19th century in Europe preferably, but I'm more than happy to hear tales from all over the world. Did firearms change the way in which urban warfare was conducted? Was there any unique aspects to this type of warfare due to muskets?
Well during the period wars weren't fought inside cities as much as they were fought outside. Sieges were a common feature during the early modern period, far more common than battles in fact, and were waged along several heavily fortified fronts such as Italy during the Italian campaigns, the Netherlands during the 80 years war, the Balkans during the many conflicts between Habsburgs and Ottomans, central Europe during the 30 year's war, and the Baltic during several struggles between Russians, poles and Swedish, to name a few.
Siege warfare had changed radically ever since the introduction of firearms. The inadequacy of the thin walls of medieval castles against artillery in the 15th century fire led to a revolution in fortification architecture, the so famed trace italienne, with shorter, thicker and sloped walls, angled bastions to provide mutual flanking fire support, and of course lots of emplacements for ordnance of a wide array of calibers with which to fire at the besiegers, not to mention moats, ditches, trenches, ramparts or any other makeshift fortification to aid the main fortress defenses and impede the operations of the enemy. Thus balance was restored and sieges again became a grueling, bloody enterprise, now with guns
Musket armed infantry featured prominently as the need to attack and defend fortifications arose, and you can see their weaponry as just the shorter end of the long continuum of firearm weaponry of the day, indeed the 16th century musket was, for all intents and purposes, portable artillery, comparable to wall guns and swivel guns also used to defend fortifications, of course the difference was that infantry firearms were significantly cheaper and much more flexible and mobile, so while garrisons could have a dozen or so guns for defense, they relied on hundreds or even thousands of musket armed infantry (as well as heavy infantry armed with pikes, swords, halberds and the like). Behind the safety of city walls or in trenches musketeers need not worry about the complicated loading procedure or the effects of fouling like they would on the battlefield, and as such can focus exclusively on accuracy, plus they can shoot resting their guns on a surface to increase stability. The outside of the fortress featured a covered way, which was a sort of trench just outside the moat from which infantry could provide a further layer of defense.
Attackers would set up fortifications of their own, called the lines of circumvallation, to surround the city and protect their operations, and lines of contravallation to stop enemy troops from attempting to relieve the city. They would dig intricate trench systems to approach the city and safely place their batteries to hit bastions and walls, as the defenders tried to stop this through artillery and small arms fire as well as daring sorties. These operations were long, costly and bloody for the attackers, and their troubles weren't over once they managed to open a breach in the defenses, for now they had to assault the breach, a bottleneck point that the besieged would defend from the inside, building a rampart to hold off the attackers, as well as scrambling to repair the damage as quickly as they could. Fortifications would also feature retrenchments into which the defenders could retreat should an outer bastion be taken.
While the nature of sieges changed because of the newfound viability of the strategy of battering down walls, other traditional methods were still being used, such as mining operations, in which besiegers would dig tunnels underneath the fortification walls and then blast gunpowder mines right below, taking the whole structure down. So while assaults and counter assaults were taking place on the surface there were also mining and counter mining operations going on below. Another method was not going under, but over, by literally bringing ladders and climbing the walls, which was naturally not as common. Lastly, armies could just outwait their opponents, blockading and closing them off from the outside world through the aforementioned circumvallation and contravallation lines and let hunger and disease take its toll, of course as long as the attrition doesn't get to them first.
In short, gunpowder weapons had become essential for the conduct of siege warfare, from the largest siege guns to the various pieces of artillery to infantry firearms and even mortars, the firepower of a well defended fortification was immense, and allowed for effective multiplication of forces as a few garrison troops could hold off way larger armies for very long periods of time
Source: Christopher Duffy - Siege Warfare: Fortress in the Early Modern World, 1494-1660 (vol 1)