Hi,
message passing is implemented asynchronously by binding functions to message ports.
[1] is the page that explains message ports in great detail.
So first you declare your message ports preferably in your blocks constructor.
Than you bind one of your functions to an incoming message port. The functions parameter has to be a pmt::pmt_t.
Everytime a message is published to this port, this function will be called.
For outgoing message ports, you just generate your pmt object and call the publish method.
Exact method names etc. are explained on the GNU Radio manual page.