I guess I have no doubt that zombies are part of the human imagination, and that they would simply spring up in our dreams even if we'd never heard of them. But I'd still like to know what the earliest known written appearance of the zombie is. I want to know if it was in a short story, someone's diary, an historical account, et cetera. Someone must have studied this, right?
This Wikipedia article covers the fiction side well.
The undead feature in the c. 7th-century BC Epic of Gilgamesh (see the other answer), creatures such as the draugr in c. 13th century Norse mythology, even the 1818 Frankenstein's monster could be considered a zombie.
One book to expose more recent western culture to the concept of the zombie was The Magic Island by W.B. Seabrook in 1929. Island is the sensationalized account of a narrator in Haiti who encounters voodoo cults and their resurrected thralls. Time claimed that the book "introduced 'zombi' into U.S. speech".
In the 1920s and early 1930s, the American horror author H. P. Lovecraft wrote several novelettes that explored the undead theme from different angles. "Cool Air", "In the Vault", and "The Outsider" all deal with the undead, but the most definitive "zombie-type" story in Lovecraft's oeuvre was 1921's Herbert West–Reanimator, which "helped define zombies in popular culture".
On the non-fiction side, this paper by John Cussans says:
The Traditional Haitian Zombie begins its literary debut in accounts of Haiti made by travel writers in the years after its independence from colonial rule in 1791.
Unfortunately no specific references are given.
Diving into Google Books, the earliest I can find is this French account of Hispaniola by Moreau de Saint-Méry, titled Description topographique, physique, civile, politique et historique de la partie française de l'Isle Saint-Domingue and published in 1797:
Une jeune beauté au teint d'ébène, qu'un conte de Zombi (*) fait trembler de tous ses membres, veille pour l'attendre, lui ouvre une porte qu'elle sait faire mouvoir sans bruit , & n'a qu'une crainte , c'est d'être trompée dans son attente.
(*) Mot créol qui signifie: esprit, revenant.
Translated into English (“waiting for him” refers to the beauty's lover):
A young ebony-skinned beauty, whom a Zombi (*) tale frightens to the bone, stays awake waiting for him, lets him in through a door that she knows how to open quietly, and has but one fear, which is that her wait was in vain.
(*) Creole word meaning: spirit, undead.
I will knock down the Gates of the Netherworld,
I will smash the door posts, and leave the doors flat down,
and will let the dead go up to eat the living!
And the dead will outnumber the living!
If you necessitate brain eating instead of flesh eating, though, I'm not aware of any books that started it - the meme seems to have originated with Dan O'Bannon's 1985 film, "Return of the Living Dead"
When the world-famous biologist, Dr. Gordon Farnham, announced that he had discovered the secret of prolonging life indefinitely, the world reacted to the news in various ways.
In this, he clearly pointed out that he had not claimed to have learned the secret of prolonging human life indefinitely, for, in order to prove that he had done so it would be necessary to keep a human being alive for several centuries, and even then the treatment might merely have prolonged life for a certain period and not for ever. His experiments, he stated, had hitherto been confined to the lower animals and by his treatment of them be had been able to extend their normal span of life four to eight times. In other words, if the treatment worked equally well with human beings, a man would live for five to eight hundred years - quite long enough to fulfill most persons' ideas of immortality. Certain persons, whose names he declined to reveal, had taken his treatment, the doctor stated, but of course its effect had not yet had time to prove his claims. He added that the treatment was harmless, that a chemical preparation injected into the system figured in it, and that he was willing to treat a limited number of persons if they wished to experiment and test the efficacy of his discovery.