If anyone else needs to create material in c++ you can do it like this:
UMaterial* UnrealMaterial = NewObject<UMaterial>();
you can also specify outer and a name and all that stuff. But what more interesting is that you can actually create material nodes in c++ and compile them. For example:
UMaterialExpressionConstant3Vector * BaseColorFactorNode = NewObject<UMaterialExpressionConstant3Vector>(NewMaterial);
BaseColorFactorNode->Constant = FColor::Red; //you can specify any color here;
UnrealMaterial->BaseColor.Connect(0, BaseColorFactorNode);
This will create a material with a const vector3d parameter in your material. I don’t know the limits of it, I only had to work with constants, textures and multiply nodes. Anyway, hope this help somebody.