Depending on the needs you can use this macro: Run rotation animation for the component using SOLIDWORKS API
GetTransform method explains how to find the rotation transformation arond Y axis by specified angle. Just modify it to get transform around Z.
After you can either use IComponent2::Transform to apply this transform permanently (it will ignore mates) or use presentaiton transform as shown in the macro.
Try this, you may need to tweak a little
Retrieving data ...