You use the CreateChar function, but first you need to request the model and then wait until it's loaded, otherwise your game will crash. This example is using the CustomFiberThread, you CANNOT put the while loop in CustomThread, it has to be CustomFiberThread:
eModel pedModel = MODEL_IG_RICKY;
CreateChar(26, pedModel, x + 2, y + 2, z, &ped, 0);
The x, y, and z are just the coordinates of Niko, and you can put +2 so that they don't spawn right on top of you. That example will spawn the Ricky Gervais model, but there's a huge list of all the models inside ScriptHook/ScriptingEnums.h file.
If you need some more help with it, I can give you my full Bodyguard Mod source code.