Now that Opus supports (some) markup in button labels, something like this can be achieved without needing external images:
This uses the code <%stars:1/1>
for the single star on the menu item and then <%stars:0/5>
through to <%stars:5/5>
for the individual functions.
Some more markup codes you can use are described in this thread.
Menu XML - paste to a toolbar in Customize mode
<?xml version="1.0"?>
<button backcol="none" display="label" label_pos="left" min_width="yes" textcol="none" type="menu">
<label><%stars:1/1></label>
<tip>Set Rating</tip>
<icon1>#newmenu</icon1>
<button backcol="none" display="label" textcol="none">
<label><%stars:0/5></label>
<icon1>#newcommand</icon1>
<function type="normal">
<instruction>SetAttr META rating:0</instruction>
</function>
</button>
<button backcol="none" display="label" textcol="none">
<label><%stars:1/5></label>
<icon1>#newcommand</icon1>
<function type="normal">
<instruction>SetAttr META rating:1</instruction>
</function>
</button>
<button backcol="none" display="label" textcol="none">
<label><%stars:2/5></label>
<icon1>#newcommand</icon1>
<function type="normal">
<instruction>SetAttr META rating:2</instruction>
</function>
</button>
<button backcol="none" display="label" textcol="none">
<label><%stars:3/5></label>
<icon1>#newcommand</icon1>
<function type="normal">
<instruction>SetAttr META rating:3</instruction>
</function>
</button>
<button backcol="none" display="label" textcol="none">
<label><%stars:4/5></label>
<icon1>#newcommand</icon1>
<function type="normal">
<instruction>SetAttr META rating:4</instruction>
</function>
</button>
<button backcol="none" display="label" textcol="none">
<label><%stars:5/5></label>
<icon1>#newcommand</icon1>
<function type="normal">
<instruction>SetAttr META rating:5</instruction>
</function>
</button>
</button>