Your second example is correct.
The “attack” roll for a bomber only applies to when it is used to attack combat units.
For an SBR, it is a roll of 1 die per bomber and the total of the die/dice is the number of IPC’s lost.
And yes, the AA guns fire first.