I haven't implemented it yet, but Gavin Andresen has a repository with what looks like a c++ and PHP implementation. I'll check it out later and post a code sample here when I get it working.
https://github.com/gavinandresen/paymentrequest
This has both a c++ and php implementation. the c++ code has a paymentrequest-create and a paymentrequest-dump. create creates the payment and dump verifies it. Use the project Readmes to compile and to understand usage.