Yes it's certainly possible. Here's an example I just put together.
It uses Apple's unsupported metal-cpp-extensions
code in order to set-up the CAMetalLayer
in the NSWindow
's view, and I had to modify that code in order to add the selectors required. After that I ported an Objective-C example to C++.