Ludwig van Beethoven's Symphony No. 3 in E flat major (Op. 55),
also known as the Eroica (Italian for "heroic")
Beethoven had originally conceived of dedicating the symphony to Napoleon Bonaparte. The biographer Maynard Solomon relates that Beethoven admired the ideals of the French Revolution, and Napoleon as their embodiment. In the autumn the composer began to have second thoughts about that dedication. It would have deprived him of a fee that he would receive if he instead dedicated the symphony to Prince Franz Joseph Maximillian Lobkowitz. Nevertheless, he still gave the work the title of Bonaparte.
That was the Wikepedia quote, but there is a whole website dedicated to this famous piece of music :
http://www.beethovenseroica.com/
Here there is no definite reason about the naming of the piece and its dedication, and the change of name, but I like this one:
Less than four years prior to the switching of the dedication, the Austrian Army had been defeated by Napoleon and the peace afforded by the ensuing treaty was dwindling to the point of certain war. It simply would not have been expedient for Beethoven to honor a potential enemy with a dedication.
John