In the unitypackage, there is a script called SpineboyTargetController
.
That is an example of how you would programmatically set the position of an IK target bone, assuming the target bone is a direct child of the root bone, and the root bone is not moved. (this setup makes the calculations and implementation a lot simpler)
spine-runtimes/SpineboyTargetController.cs at 3.6
This is used in the bundled "3 Object Oriented Sample" scene.
When you click, the the shooting and aiming animation will play which points the gun at the target using IK, and plays the firing animation.