The following published sources contain macro examples. The most obvious example is the documentation from Sun. Start from Sun's documentation site
https://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