The earliest use in print I found of the exact phrase "flip the bird" or "flipped the bird" or "flipping the bird" is from a 1967 Broadside (Volume 6, Issues 17-26).
(The Grateful Dead flipped "the bird" to the audience, tuned their instruments, blew up amps — for what seemed like FOREVER —then disappeared, leaving people disappointed and brought down.)
The gesture is much older. Flipping the Bird: The Origins of Everyone's Favorite Middle Finger Gesture tells us:
The Romans did not invent this gesture, however. The earliest recorded mention is a play "The Clouds", written by the Greek Aristophanes in 423 B.C. Even then, the middle finger has a clear, obscene and sexual use. It is unlikely that the ancient Greeks were the founders for flipping the birdie. More likely, flipping someone off goes back into prehistory.
Here's a 20th century translation of The Clouds:
SOCRATES: Well, to begin with,
they’ll make you elegant in company—
and you’ll recognize the different rhythms,
the enoplian and the dactylic,
which is like a digit.
STREPSIADES: Like a digit!
By god, that’s something I do know!
SOCRATES: Then tell me.
STREPSIADES: When I was a lad a digit meant this!
[Strepsiades sticks his middle finger straight up under Socrates’ nose]
SOCRATES: You’re just a crude buffoon!