This is exposed through the IPrintManagerInterop interface in the PrintManagerInterop.h header.
What makes these awkward is that this is an interface exposed on the activation factory.
winrt::Windows::Foundation::IAsyncAction main_window::on_lbuttonup(mouse_vkey, int32_t, int32_t)
{
HWND my_hwnd = get_handle();
auto af = winrt::get_activation_factory<winrt::Windows::Graphics::Printing::PrintManager, IPrintManagerInterop>();
winrt::Windows::Graphics::Printing::PrintManager print_manager{ nullptr };
winrt::check_hresult(af->GetForWindow(my_hwnd, winrt::guid_of<winrt::Windows::Graphics::Printing::IPrintManager>(), winrt::put_abi(print_manager)));
//Set the PrintTaskRequested event here.
winrt::Windows::Foundation::IAsyncOperation<bool> print_manager_show{ nullptr };
winrt::check_hresult(af->ShowPrintUIForWindowAsync(my_hwnd, winrt::guid_of<winrt::Windows::Foundation::IAsyncOperation<bool>>(), winrt::put_abi(print_manager_show)));
co_await print_manager_show;
co_return;
}
It is also an ABI interface, so it is a bit of a pain to use, but it is easy enough to wrap it if desired. The important parts of this are the use of this one particular winrt::get_activation_factory template overload. The first template parameter provided is the C++/WinRT projection type that we wish to get the activation factory for, and the second template parameter is the interface that we wish to query for. IPrintManagerInterop::GetForWindow is called, to get an instance of Windows.Graphics.Printing.PrintManager, and we place it in the C++/WinRT projection type using winrt::put_abi. The interface that this queries for, IPrintManager, is important. This is the default interface for the PrintManager runtime class and it is what C++/WinRT expects.
Once the PrintTaskRequested event handler has been set, IPrintManagerInterop::ShowPrintUIForWindowAsync is called. Again, this is an ABI member, so the C++/WinRT ABI compatibility functionality is used to place it in a C++/WinRT projection type. We then await on the async type.
This should work, but I admit that didn't have a printable document available. This is the kind of code that should be expected. As a side note, this is in a Windows API application, not a WinUI 3 application. So this code shouldn't just be copied as is. But this is an idea as to how any event handlers should be formed. The return is required in C++ to make this into a coroutine, this allows the use of co_await.