The Noctambule

Literally “sleepwalker” or “nightwalker” or perhaps “night crawler” in French – referring to those who like to ramble in the city at night, hence “noctambulism.” The Noctambule is a venerable tradition in French Gothic arts, music and literature that had its heyday back in the 19th century when it referred mainly to vampires. It lingered into the 20th with the likes of novelist Henry Miller who liked to prowl Montmartre at night and avant-garde artists seeking ways to protest the perceived horrors of modern life. Nowadays it pretty much covers everything from websites for amateur astronomers and party-goers, to high-end lamps and Givenchy perfumes and Louis Vuitton bags (black of course).

In earlier centuries, the Noctambuli were associated demonic influences:
Seventeenth-century readers were fascinated by marvellous tales of people known as the noctambuli who rose up in their sleep, performed daily chores and attempted dangerous feats, such as clambering onto rooftops. On account of their uncanny nature, commentators noted that sleepers could be mistaken for spectres or those who had been bewitched. Depictions of the noctambuli were also influenced by the Malleus Maleficarum, which had argued that they were acting under the influence of demons . - Elizabeth Hunter, University of London
It was only a short step from there to imagine people selling their souls to this dangerous figure. The earliest seems to have been Theophilus of Adana, who died circa 538. Frustrated in his career, he sold his soul to the Devil, but was redeemed by the Virgin Mary. Many other examples followed, since it was easy to accuse a rival of demonic advancement. One of them was Johann Georg Faust, a likely conman, on whom Christopher Marlowe and Goethe built their own versions. The Devil, it seems, was everywhere in medieval times and beyond and many ancient stone bridges are named after Him.

On the other hand, almost everybody else cheated the Devil successfully, like Ninon de Lenclos, while there were others, like Goethe's Faust, whom the angels had to rescue. But a few lost the bet, like Adrian Leverkühn in Thomas Mann's Doktor Faustus. Leverkühn "strikes a Faustian bargain for creative genius: he intentionally contracts syphilis, which deepens his artistic inspiration through madness" (Wikipedia), but it doesn't end well.
Another was Pan Twardoski, a very popular figure in Polish folklore. He thought he could outwit the Devil by inserting a clause into the contract that he would only give up his soul if he died in Rome, and he had no intention of going there. The Devil catches him out when Twardowski stays at an inn called Rzym (which is "Rome" in Polish). Here he is on his way to Hell:

Pan Twardowski is said to have lived in Kraków, the capital of Poland at the time. The great Polish poet Adam Mickiewicz, who was unable to live in Poland while it was under Russian, Prussian and Austrian occupation, had a bit of fun with the legend early in his career. In the ballad Pani Twardowska (1822), "Twardowski agrees to be taken to Hell on condition that the Devil spends a year living with his wife, Pani Twardowska. The Devil, however, prefers to run away and thus Pan Twardowski is saved." (Wikipedia).
Also see Faust, Don Juan and The Master and Margarita.