If a marriage is annulled that means the union was never valid. If the union was never valid, then was the couple living in sin? Can you really say you were chaste if the marriage was never really a marriage?
I researched this question when I was studying about the priesthood. I read somewhere that bastard children weren't eligible to be priests, and so I had to ask myself, "Am I bastard?" as my parents had divorced and had their "marriage" annulled.
The answer I found was that children that were produced during a "marriage" that was later annulled are legitimate children, as the "marriage" was believed
by the Church to be legitimate at the time. It was only after questioning the legitimacy of the marriage and study on behalf of the commission responsible that it was later determined that the "marriage" wasn't truly a marriage.
So, to answer your question, no, those who have their "marriage" annulled were not living in sin, as it was believed by the Church and the couple that their marriage was valid.