In your header, something like:
public:
UPROPERTY()
AMyWeapon *myWeapon;
If you want it to be blueprint accessible, you need to add the proper tags in the UPROPERTY. Then just spawn the actor as you are doing. With this exception, obviously:
// Don't declare a local variable, just assign it to the one in the class.
myWeapon = GetWorld()->SpawnActor<AMyWeapon>(AMyWeapon::StaticClass(), spawnParams);
You probably should study up on your C++ some more.