Apparently CreateDefaultSubobject has multiple overload. I just tried and this seems to compile fine.
TSubclassOf<UPCGameplayUnitComponent> TestClass;
UPCGameplayUnitComponent* TestComp;
TestComp = Cast<UPCGameplayUnitComponent>(PCIP.CreateDefaultSubobject(GetOuter(),TEXT("GameplayUnitComponent2"), TestClass, TestClass, false, true, true));