In my last fort, a 40.19 game, a Roc came to visit.
Having no prior experience with this, I 'savescummed' (copy save, paste, reload etc) a few times to try a couple different strategies.
I never went very far back in time however, only to just before it arrived.
Generally, each time, it went something like this: the Roc would chase after something, usually my pastured animals,
(which I have in large square pastures covering the 180 degrees outside my main hillside gate, while the opposite/other 180 degrees is a mountainside/upsloping area.
Fortunately, I had been putting cage traps all over at this point, and had started building a 1-2 level high wall around an area of pasture surrounding my hillside fortress gate/entrance.
Unfortunately my wall was not nearly complete, and certainly had no ceiling or protection from climbing/flying things.)
catch something, tear it apart in a matter of 2-3 seconds, scattering body parts all over in a 10-20 radius area, then go after something else.
If I managed to pull all the dwarves inside to hide, and station my military at a suitable choke-point far enough away to not see/auto-attack the Roc yet be in position to at least cause it some trouble if it came inside, it would continue slaughtering farm animals outside.
Once, I had a "THIS IS MY FIGHT TOO"-dwarf "see" the Roc, through a bunch of rock/wall from his post in the long entrance corridor,
and run outside to avenge my poor pet pig who was recently being Roc-butchered just outside.
He lasted a bit longer than a farm animals, with some humorous fighting being done from a prone position, using his fists,
after he was almost immediately so horribly injured he couldn't hold his weapons, shield or even stand up.
Then the Roc walked into one of the cage traps I had [put just beside my main entrance to avoid blocking caravans],
and it was all over as suddenly as it began.