I'm reading Donald Keene's biography of Emperor Meiji, and I can't quite find any defining events that led to the change in relationship between the shogunate and the imperial court during Komei's reign. Keene appears to suggest that the shogunate just started taking the imperial court's advice all of a sudden when Western powers began to take more notice of Japan, but it seems like the imperial court was largely ceremonial before this. What caused this sudden shift in the power balance between Emperor Komei and Tokugawa Iemochi, given the relationship that had existed for centuries prior?
Komei was pretty furious that Westerners, which he had known nothing about, had showed up and started causing trouble, while the shogun, who was supposed to keep control of the county, was letting them run amok. Growing anti-Western tensions led to the sonno joi (Expel Barbarians (foreigners), Revere the Emperor) movement. Because the Shogunate was perceived as not helping the situation, it also led to a growth of anti-Shogunate sentiment.
This culminated in the bombardments of Shimonoseki and Kagoshima, where members of Choshu domain and Satsuma domain started striking out against foreigners. When the West intervened, and the Shogunate did nothing to fight the foreigners, this led to resentment. In addition, the heads of Choshu and Satsuma, the Mori and Shimazu clans, respectively, were strongly opposed to the Tokugawa shogunate since its inception, having fought against Tokugawa Ieyasu in the 1600s and being defeated. Choshu was mad because it had backstabbed Satsuma and gotten penalized by losing its ancient lands, while Satsuma was obviously mad for losing to Tokugawa treachery. While both clans also hated each other, the Shogunate's reluctance to fight the foreigners caused them to seek an alternate source of leadership.
The straw that broke the camel's back was the Choshu punitive expeditions. Shogunate forces attempted to subjugate a rebellious Choshu, but many retainers committed half-heartedly, while Choshu had built a small but well-equipped and trained army (see the Kiheitai). This caused the Shogunate to lose much face, and gave the opportunity for Satsuma and Choshu to seize power.
Sources: de Bary, Sources of Japanese Tradition, Jansen, Sakamoto Ryoma and the Meiji Restoration