This "it" is not only an empty subject used to introduce the real subject -- it refers to a person mentioned in the context that was, up to that moment, unidentified.
On page 349 of "A Comprehensive Grammar of the English Language" by Quirk et al we find an interesting example with its explanation:
"The bell rang, and I went to the door. It was Dr Long. (4)"
That "it" refers to the person who rang the bell.
Quirk says: "To make full sense of sentences like (4), we have to supply, for example: It was Dr Long (who had rung the bell)."
Similarly, in your example:
A: Who was the man we saw with Anna yesterday?
B: I don't know. It may have been her brother.
"It" refers to the unknown, unidentified man that was seen with Anna yesterday. Once the person has been identified, a personal pronoun will be used to refer to him. Notice the change of pronoun if the conversation goes on:
A: Who was the man we saw with Anna yesterday?
B: I don't know. It may have been her brother.
A: Well, whoever it was, he looked like a nice guy.