With the construction you have chosen, the comma is required. If you reverse the clauses, it's not needed.
When I unzipped my beanbag cover, a XXX dropped off.
A XXX dropped off when I unzipped my beanbag cover.
Note that (in BrE), "beanbag" is one single word. I'm intrigued to know what "xxxxx" was!
Interested in Language