This post contains spoilers.
The episode is about Martin Bailey who is basically confined to bed because of an illness that the episode never specifies. His dog, apparently named just Dog, helps him to learn about the outside world by bringing various items back to him. Early in the episode, it brings back a variety of leaves and plants, and these allow Martin to determine where the dog has been. One day, Martin attaches a sign to the dog that reads, "Martin Bailey owns me. Sick in Bed. Needs company. Follow me." The dog returns with Miss Haight, who would have been Martin's teacher had he been well enough to attend school. Over the next few weeks, Miss Haight regularly visits, always announcing herself with a cheery, "Company!" and bringing Martin a variety of books to read.
After Miss Haight is suddenly killed in a car accident, Martin becomes preoccupied with thinking about the dead, specifically how "it doesn't seem like much fun" for the corpses simply to lie underground. He asks his parents, "Why don't they jump up and run around once in a while?"
Shortly after Miss Haight's funeral, Dog disappears and is missing for a day. On the evening of what is apparently Halloween, it returns, and when Martin examines it to see where it's been, he finds mud and worms. As he asks the dog where it's been digging, the lights in his room go out. A glow comes from the doorway where a hand pushes open the door and a voice announces, "Company!"
Taken one way, this could be precisely the thing that Martin has been thinking about: the dead "jump[ing] up" out of their graves and "run[ning] around." In this case, Miss Haight is dug up by Dog, and she visits Martin once again.
Since Martin has some sort of illness, however, it's also possible to view these events as hallucinations that he experiences as he dies. The dog doesn't really return covered with mud, and the hand of a corpse doesn't really push open the door to Martin's bedroom. His illness and his preoccupation with the dead simply make him believe these things in his final moments.
Miss Haight's last words to Martin were "Hurry up! I'll be waiting," so the "Company!" that he hears at the end of the episode could be upon his meeting her in the afterlife, not her coming back to his bedroom.