The way I generally do it is: declare the material in .h (this is in case you create blueprints based on the cpp class:
UPROPERTY(EditAnywhere)
UMaterialInterface* MaterialRef;
Set the reference in the blueprint, and then you can use it in your cpp.