Here is some of an article by Glenn Church, that I found at Associated Content:
The Romans referred to the middle finger as digitus infamis or digitus impudicus (dirty finger). It had much the same meaning as today. The Emperor Caligula insulted people by making them kiss his middle finger instead of his hand. Another Emperor, Augustus Caesar, expelled an entertainer from his presence by an obscene wave of his middle finger.Fascinating. They can't find an origin, it's such an old habit. Think of it: even the Latin language has died out, yet we still make daily use of this even more ancient relic. I guess when something so perfectly serves its purpose, there's no reason to put it aside.
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.
The middle finger, extended outward from the rest of the fingers, is an unmistakable phallic symbol. Some have even suggested that the middle finger's use as a sexual instrument, in place of the male organ, is its true origin as a phallic symbol.
I like the word digitus impudicus. I think I'll keep it.