I read a lot about asymmetric encryption and still can't understand how is the step by step process to achieve what I need.
What I need:
What I don't understand:
Using the example here: Signing Data with CNG I don't get how can I create the keys once then store the private one in my c++ app and the public one in my api (php).
What I achieved
I learned to hash and encrypt/decrypt data using bCrypt but I don't understand what steps I have to do to achieve what I wrote before
You have to change the design. Currently you design has a major security flaw. You got the concepts of the pubkey/prikey correct, but the implementation is incorrect. The private key should be kept private. Currently it is easy to derive the public key, given the private key for a lot of algorithms, but not the other way around. The right design is as follows.
All of the above steps are well documented with samples on MSDN. If you need further help, let me know and I can point it to the articles.
The above design will make sure that your private key is never in the wild. If you distribute your private key in your application, it will take literally only few minutes to get your private key.
Storing the public key in the application is just the matter of either hardcoding the key in the application using byte array or putting the certificate in the resource file.
The private key portion of the key pair should never be hardcoded in any application. The private key should be non exportable and be managed by the operating system only. Windows now has keyguard that uses VSM technology that makes it impossible for even the local administrator to know the private key. The admin can only use it for signing and verifying (and exporting the key, if exporting is enabled) but never be able to look at the private key and misuse it.
Regarding step by step process.