I found this link to be very useful.
Inside the OnConnection method, I had this:
CommandBars cmdBars = (CommandBars)applicationObject.CommandBars;
CommandBar codeWindowCmdBar = cmdBars["Code Window"];
CommandBarPopup doxygenPopup = (CommandBarPopup)codeWindowCmdBar.Controls.Add(MsoControlType.msoControlPopup,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
1,
true);
doxygenPopup.Caption = "Doxygen Commenting";
CommandBarControl mnuListItem = (CommandBarControl)doxygenPopup.Controls.Add(MsoControlType.msoControlButton,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
1,
true);
mnuListItem.Caption = "Wrap as List Item";
mnuListItemHandler = (CommandBarEvents) applicationObject.Events.get_CommandBarEvents(mnuListItem);
mnuListItemHandler.Click += mnuListItemHandler_Click;
CommandBarControl mnuUnorderedList = (CommandBarControl)doxygenPopup.Controls.Add(MsoControlType.msoControlButton,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
2,
true);
mnuUnorderedList.Caption = "Wrap as Unordered List";
mnuUnorderedListHandler = (CommandBarEvents)applicationObject.Events.get_CommandBarEvents(mnuListItem);
mnuUnorderedListHandler.Click += mnuUnorderedListHandler_Click;
CommandBarControl mnuOrderedList = (CommandBarControl)doxygenPopup.Controls.Add(MsoControlType.msoControlButton,
System.Reflection.Missing.Value,
System.Reflection.Missing.Value,
2,
true);
mnuOrderedList.Caption = "Wrap as Ordered List";
mnuOrderedListHandler = (CommandBarEvents)applicationObject.Events.get_CommandBarEvents(mnuListItem);
mnuOrderedListHandler.Click += mnuOrderedListHandler_Click;
Inside the click event handlers I did whatever was needed.
Please not that this was for a main menu item with sub items. For just a single item, check out this video. The guy goes step by step... Very well done.