In order to do it we will reuse SiteActions control (Sharepoint uses it for Site actions menu). We need to create inheritor and override its Text property in order to show custom title:
After that we can add this control to the masterpage and define custom menu items:
Note that we changed Location and GroupId properties to the custom values. They can be used in order to add custom actions to the custom site actions menu via features (by the same way as they are added to the standard menu). With this technique you will be able to create custom actions menu which looks like OTB Site actions.