A church annulment is not the same as a civil annulment. I don't know how a civil annulment would affect the status of the children (though I've never heard of a civil annulment of a consummated marriage). Legitimacy and illegitimacy are civil categories, not religious; they have to do mostly with things like enforcing child support obligations, inheritance rights, etc. A church annulment has no effect on the legal status of the children: if the marriage was legal (civilly), the children are legitimate, whether it was valid to the church or not.
I'm not sure that's entirely true, at least in Europe. Most patents of nobility restrict inheritance to 'male (or 'male and female') heirs of legitimate marriage' and, in those countries that required Church marriage for a marriage to be 'legitimate' there is a question of the effect of an annulment on heritabilty of children from the first marriage.