Not in anything by Arthur Conan Doyle. But I'm sure someone, somewhere, has written a story where they team up.
Of course, seeing as Moriarty is just as smart as Holmes, and has a great deal more resources and less moral hangups, I can't imagine why he'd ever need Holme's help.