Hello,
You can look at the RM code as an example and you can take it from there.
Why can not you refer to the RM code, if one can ask? Can you also please give us some more details about the kind of add on that you are working on and what data do you want to display on the sidebar?