In addition to
The Sixth Sense, M. Night Shyamalan used the twist ending in
The Village as well.
The Others and
Psycho are two other good examples. SPOILER: Of course
The Others does use the same idea as
The Sixth Sense, a ghost not realizing they are dead, as its twist.
As far as in literature, both O. Henry (William Sydney Porter) and Saki (Hector Hugh Munro) were famous for using twist endings in their short stories. O. Henry was so famous for it that twist endings became popularly known as "O. Henry Endings"
"You pile up enough tomorrows, and you'll find you are left with nothing but a lot of empty yesterdays. I don't know about you, but I'd like to make today worth remembering." --Harold Hill from The Music Man