[UE5.1][C++] How can I pass a widget to my player character ?

In your class character you can create a reference of your widget and the class it uses which you expose in Blueprint

here in your Character.h:

    UPROPERTY()
	UMyWidget* MyWidget;
	UPROPERTY(BlueprintReadOnly,EditAnywhere)
	TSubclassOf<UMyWidget> MyWidgetClass;

then in your cpp you can create it and do whatever you want

if(!IsValid(MyWidget))
	MyWidget= CreateWidget<UMyWidget>(GetWorld()->GetFirstPlayerController(),MyWidgetClass);
if(IsValid(MyWidget))
{
    MyWidget->AddToViewport();
		
    //Do your update in your cpp 
    MyWidget->UpdateHealth();
    MyWidget->UpdateItem();
}

in your Blueprint, just set MyWidgetClass to the widget you created in the editor.