The following published sources contain macro examples. The most obvious example is the documentation from Sun. Start from Sun's documentation site
http://docs.sun.com/app/docs and search for StarOffice documentation.
Andrew Pitonyak wrote a book called OpenOffice.org Macros Explained. Two chapters are available as direct downloads from the publisher. See