You can't. There are very few limitations of macros compared to add-
ins, but this is one : you can't use the callback functions system
from macros, so you can't handle menus from macros.
Callback functions are those called when you call a toolbar button, or
a menu (regular or rmb). Those callback functions have to be in a DLL.
Check Frame::AddMenuPopupItem in API help to see how it works.
A nice way to circumvent this limitation is to build an addin which
can be parametrized to build toolbars and macros and then call
specific macros. Axemble (french VAR) has made something like this for
their set of tools you can get from here
(don't remember if it handles RMB).