Dumbledore would also be involved. As the wise headmaster, he would be the one with the most knowledge and resources to deal with Harry's situation. He might have some ancient magic or wisdom that could potentially help Harry regain his normal mental state. He would also be guiding the other characters in their efforts to help Harry.
Hermione would definitely be one of the main characters. She would likely be very concerned about Harry and try to find a way to reverse his mental regression. She might spend hours in the library researching spells and potions to cure him.
Another storyline might involve a magical artifact that accidentally causes Harry to regress mentally. He could then start seeing Hogwarts in a completely different light, like it's a huge, exciting playground. He might be more interested in exploring the castle's secrets for the fun of it rather than for any serious purpose, and his relationships with his professors also change as they have to deal with this new, child - like Harry.
One possible character could be the person he is supposed to marry according to the contract. This character might be from an old wizarding family, and they could be initially angry or disappointed with Harry's refusal. Another character could be Harry's best friends like Ron and Hermione. They would likely support Harry in his decision, especially Hermione who is a strong advocate for free will and individual choice.
Ron could also be a main character. He may be initially scared of Harry's ghostly presence but then tries to help him. He might be the one who goes on adventures to find a way to reverse Harry's situation, like looking for a rare magical object or an ancient spell.
Snape could also be part of it. He might catch Harry in a rather awkward moment when he's trying to hold it in and give him a hard time. Or, on the other hand, he could surprisingly offer some help in a very Snape - like way.
Hermione would definitely be involved. She's always been by Harry's side, and in this kind of fanfic, she would likely be helping Harry in his struggle, using her intelligence to figure out solutions to the problems he faces. Ron would also be there, providing his loyalty and courage in the fight. Dumbledore might make an appearance too, perhaps as a guiding spirit or in flashbacks, offering his wisdom to Harry as he battles towards salvation.
Maybe Neville could be involved too. He has shown great courage in the original series. In this fanfic, he could be the one who has some prior knowledge about the dragon due to his family's history in the wizarding world. His knowledge could be crucial in helping Harry enter the dragon's territory and deal with whatever lies within.
Hermione Granger is often involved. She's Harry's best friend and is extremely intelligent. Her knowledge of spells and magic history can be crucial in helping Harry prove his innocence. She might research old laws or spells that can be used as evidence.
The Weasley twins could be part of it too. Suppose Harry yells in excitement or anger about a new prank idea that the twins have come up with that might be a bit too dangerous. They could either encourage his yelling or try to tone it down, depending on their mood. And Malfoy might overhear Harry's yell and use it as an opportunity to taunt him, adding more conflict to the fanfiction.
Obviously, the illithid would be a main character. It could be a mysterious and powerful being that Harry encounters. Also, Hermione and Ron might still be important characters. They could be either suspicious of the illithid or try to help Harry understand it better. Dumbledore might also play a role, perhaps guiding Harry in his interactions with this strange new creature.
Ron could also be a main character. He might be a bit scared or jealous of Harry's new - found ability. But in the end, he stands by Harry. Maybe there's a scene where Ron has to overcome his fear of snakes when they are in a dangerous situation that requires Harry to talk to a snake for help.