To create node, i can’t do more than give link with informations as i never did myself : Custom Blueprint Node Creation tutorial - Community Content, Tools and Tutorials - Unreal Engine Forums
about the way to do in c++, first link has it in.
I can’t help you more with c++ sadly.