I was always fascinated with movies and stories about old libraries, where the protagonist researches old books or scrolls about supernatural, religious or philosophical themes. Did these really exist in some form, say for example in monastic libraries? And was there "interesting content" like stories, philosophic essays etc. or mainly birth and death registers?
Short answer is "yes." The literary trope of the grimoire is based on the historical reality of grimoires and related literary works - to a degree. The best beginning guide to this genre of literature is Owen Davies' Grimoires: A History of Magic Books.
That said, the reality of the historical grimoire tends to be a lot more prosaic than the more fantastical versions in movies - anthropodermic bibliopegy (binding books in human skin) was an occasional practice in history, but generally not for works on the occult. The term "grimoire" specifically refers to works with a magical system or formulae, like the various recensions of the Key of Solomon or The Sixth and Seventh Books of Moses; what you see a lot more of are other miscellaneous religious works - Bible commentaries, gnostic and Manichaean texts, apochryphal or noncanonical gospels, works of philosophy or metaphysics, etc. - which aren't explicitly magical (although still occasionally heretical, depending on the authority in question). Contents varied widely, but could include cosmology; stories and parables; lists of angels, demons, and spirits; properties of natural materials; seals, circles, and tables for magical operations; instructions for creating tools and various operations, etc.
Some of the grimoires you see in film are fictionalized versions of real books - for example in the film Warlock the "Grand Grimoire" is loosely based on Le Veritable Dragon Rouge, a popular 16th century grimoire. Others are purely fictional, like the Necronomicon created by H. P. Lovecraft, a version of which stars in the Evil Dead film series and Ash vs. Evil Dead television series. For more on the latter, I recommend Harms and Gonce' The Necronomicon Files.
Many historical grimoires are out of copyright, and the text of various editions can be found for free on www.sacred-texts.com - although this generally follows early 19th and 20th-century print publications of these works, not the handwritten originals from the 16th century or earlier.
If you want a specific example of a primary text like this, my home institution has recently put together an online exhibition related to one of the more fascinating texts in our Special Collections, Johannes Tinctor's Invectives contre la secte de vauderie, which is essentially a 15th-century guide to witch-hunting, and predates the Malleus Malifecarum by a couple of decades.
The book serves as both description and justification for the witch-hunting panic that started in Arras in 1460, and gives lawmakers a cosmology that allows for witchcraft to exist within the confines of religious understanding, and a description of the power of witches and witchcraft, as well as laying out a persuasive (apparently) logical case for pursuing and prosecuting those suspected of being witches.
Although the frontispiece of this particular copy is missing, it is presumed - based on the illustrations of other, slightly later copies - that this book would have once had one of the very earliest illustrations of a witch in flight, along with a goat-like Devil as the object of worship.
I've seen the book in person: it's beautiful, and a little creepy, and was one of the texts that opened the door for a massive - and very real - amount of persecution, oppression and suffering.
One of the first people that comes to mind when you mention Grimories or at least magical handbooks is Heinrich Cornelius Aggrippa. He wrote three books on occult philosophy with the intent of finding out (more or less) how magic phenomenologically interacts in the world. He was attempting to bridge the gaps between mysticism and scientific practice at the time with a Platonic system where the theurgic principle was magic. There were a lot of traditions that he followed the trajectory on, taking heavy influence from a lot of works that were either quite abstracted or sometimes misrepresented in translations (such as the Greek "mysterium" and Latin "sacramentum"- cool source article).