Hi Michiel,
You have to enable the package on the SBMLDocument instance.
In addition you have to set the required and strict tags for fbc.
Depending on if you have a strict or non-strict model you set the strict tag (see the fbc specification for definition).
Afterwards you can just get the extension plugins and set the information on them (similar to reading them from a file with the package)
Hope this helps.
Code example is based on the python bindings, but should easily transfer to the other libsbml language bindings.
Best Matthias