I kind of head-canon him as gay, but I don't know if it really matters. I agree that there does seem to be a sexual element in his attraction to Sherlock. Sherlock certainly sees him as sexual. But I think Moriarty also uses sexuality to unsettle people, regardless of gender, in a similar way to Magnussen. I don't think it's so much a case of him fancying them as him wanting to make them uncomfortable or maybe manipulate them.
I don't think Jim from IT is an aspect of Moriarty. I think he's entirely a creation of Moriarty's, a disguise. The signs that Sherlock picks up on are all clues that Moriarty left for him. Which was quite audacious really - he absolutely fools Molly, which is probably easy enough, but with Sherlock he lets him think that he sees through him, when in fact he's only seeing the surface layer. He doesn't pick up that this is somebody in disguise. I love that scene ... particularly as Sherlock is pointing out that John misses out on anything important with the shoes, while doing exactly the same thing with Jim!