How can I create a subobject for user-defined class?

Do it in BeginPlay using SpawnActor.

Weapon = GetWorld()->SpawnActor<AWeapon>(FVector::ZeroVector, FRotator::ZeroRotator);
Weapon->AttachToComponent(RootComponent, FAttachmentTransformRules::SnapToTargetIncludingScale, FName(TEXT("index_01_r")));