As we know Gandalf had a far bigger plan than the dwarves when he decided to join their quest of reclaiming Erabor. Smaug, the dragon, was always on his mind, and he feared that Sauron would gain control over it. This would be catastrophic for the good people of Middle Earth as it would lead to 2 (possibly 3, if we include Isengard) fronts in the great war.
My question is however, how did he plan to kill Smaug? He surely couldn't count on Bard hitting the dragon with one black arrow (or predict that the dragon would go to Laketown in the first place).