From Arcana Coelestia ~ Emanuel SwedenborgIn general there are with man spirits of such a quality as is the man himself. If he is avaricious, there are spirits who are avaricious; if he is haughty, there are haughty spirits; if he is desirous of revenge, there are spirits of this character; if he is deceitful, there are the like spirits. Man summons to himself spirits from hell in accordance with his life. The hells are most exactly distinguished according to evils of cupidities, and according to all the differences of evil. Thus there is never any lack of spirits like himself to be called out and adjoined to a man who is in evil.
The evil spirits with man are indeed from the hells, but while they are with him they are not in hell, but taken out from thence. The place where they then are is midway between hell and heaven, and is called the World Of Spirits.... In this world called the world of spirits there are also good spirits who likewise are with man. Into that world also come men immediately after death, who after tarrying a while there, are either sent away into the lower earth, or are let down into hell, or taken up into heaven, each one according to his life. In that world, the hells are terminated above, being there closed or opened at the good pleasure of the Lord; and in that world, heaven is terminated below; thus it is an interval that distinguishes heaven from hell. From this it may now be known what the world of spirits is. When evil spirits who are with man are in that world, they are not in any infernal torment, but are in the delights of the love of self and of the world, as also of all the pleasures in which the man himself is; for they are in every thought and every affection of the man; but when they are sent back into their hell, they return into their former state.
(Arcana Coelestia 5851, 5852)