For hundreds of years Satanism was a mythical religion that Christians made up in order to persecute pagans. During the Middle Ages many so-called witches confessed (under torture of course) to performing rituals (such as the "Black Mass") which never existed in the real world — but were merely devised (by the Catholic church) as propaganda for scaring people.
The most scholarly book on the subject is probably The "Malleus Maleficarum" and the Construction of Witchcraft: Theology and Popular Belief (Studies in Early Modern European History)
by Hans Peter Broedel.
A good mainstream book on the subject is Joseph McCabe's "History of Stanism".
A nice summation can be found at http://www.answers.com/topic/satanism
"Before the fifteenth century, the magic practices (i.e, witchcraft) associated with paganism had been defined as unreal and pagan belief as disbelief. However, for several centuries the Roman Catholic Church had been engaged in a struggle to eliminate heresy, especially in southern France. That successful effort had left it with a large and efficient organization, the Inquisition, essentially bereft of a job. Thus the redefinition of witchcraft as Satanism served the purpose of providing work for those conducting the Inquisition. It transferred witchcraft from the realm of doubt to that of heresy and apostasy, and thus the concern of the Inquisition. Satanism implies the acceptance of Christianity and the subsequent transfer of allegiance to the Christian anti-God.
Immediately after the papal bull Summis desiderantes affectibus, issued in 1484, which unleashed the Inquisition, two German Dominicans, Jakob Sprenger and Heinrich Kramer, wrote a massive text, Malleus Maleficarum (The Witches Hammer), which became the textbook for witch-hunters in understanding the evil of witchcraft and in locating and identifying witches. Witches were accused of sacrificing infants and of having sexual intercourse with the devil (most witches were women). Since the Bible affirmed the existence of witchcraft, to believe it did not exist was to be considered in itself a heresy, according to the inquisitors.
Thus was initiated the era of the great witch-hunts. In spite of the Reformation, which split the church and commanded so much attention in the sixteenth century, the crusade against witches continued and was pursued by Protestants and Catholics alike. Confessions were obtained by torture and tended to conform to the image expected by the inquisitors after having read the Malleus Maleficarum.
There is no real evidence that a devil cult existed. Its description in the Malleus Maleficarum was the result of the imaginings of a group of people who had never seen what they described. The confessions were extracted from people informed as to the nature and content of what the inquisitor sought. Such has remained the case to the present. Even though some groups of Satanists emerged, they were always adult converts and created the organization de novo each generation. There was no Satanic organization to carry the tradition from generation to generation. Thus the imagination of Christian clergymen was necessary to inform each new group of Satanists as to the beliefs and activities of Satanism. Without the writings of Christian anti-Satanists, Satanism could not exist."
More sources include: