I dont have a sample, I know you can check at the HP Reference guide for add new user method and add the user to specific group , check for the "Add a project user to a group " in the OTA reference the method to add a user to project and group is called : AddProjectUser
regards