During occasions where something a little more sophisticated is required, you don't want pair your wedding or anniversary cake with just any wine. You want to make sure that EVERYTHING is perfect.
To give an accurate cake pairing, a specific cake flavor is needed. So here's a few wine and cake flavor pairings I found on http://www.hellovino.com/wine/pairing/cake.
If you're going with the more traditional flavor of Vanilla cake then your classic Chardonnay is the perfect match. Its light buttery flavor and hints of oak enhance the sweet buttery flavor of your cake and compliment the vanilla. Other wines that pair nicely are Tawny Ports and Sparkling Wine (Rose').
A nice dark red wine like Cabernet Sauvignon compliments chocolate cake with its red berry flavor and hints of spice. Muscat and Madeira pair well also.
For less traditional cake flavors like carrot cake a Riesling is best. Rieslings are sweet wines with peach and orange blossom flavors that compliment the earthy, spicy tones of carrot cake. Again Madeira's nutty carmel flavors come in to play and compliment well here. Tokaji has all the same flavor qualities as carrot cake so if you're looking for something that matches the flavor profile perfectly then this is the one for you.
For a complete run down of more cake flavor and wine pairings visit the website above.