Your hand skeleton needs to have every possible bone on it (magazine, bullet, etc.).
Then when you animate your weapon, you import the animations onto the hand skeleton.
Finally you import the weapon mesh (no hands) as a skeletal mesh. Use SetMasterPoseComponent on it and set the master to the hand skeletal mesh. It should attach and follow the bones as needed.