If I may chime in with a bit of advice here:
The best way to accomplish this is probably to break it down into a series of discrete tasks, as follows:
1) Determine the best way to generate a compass heading from a click. Seems to me the easiest way to do this is to use trigonometry: Given X and Y coordinates relative to a central point, you can find the compass heading by calculating arcsin( Y / sqrt(X^2+Y^2) ). You may have to convert from radians to degrees depending on your math library. So, first write a simple function to convert X and Y coordinates to a compass heading.
2) Now you just need to get X and Y coordinates. You can do this by taking an existing class and creating a subclass, and putting your custom code there. When you click on an object, a call gets made to the object's mouseDown method. So, you need to add a mouseDown method to your object, that handles the incoming message. In this method, you should be able to figure out some way to determine the relative location of the click (I believe it's passed as part of the single parameter to mouseDown, encapsulated in an NSEvent object). However, you'll find that objects tend to have their coordinates start at one corner rather than nicely in the middle (I think it's the lower left by default), so you'll need to convert those coordinates to coordinates relative to the object's center by calculating it's frame size and doing a bit of math.
3) Put your function from the first step into the class from the second step, and call it from the mouseDown handler to determine a compass heading. You should test everything at this point to make sure everything is working. Using printf to check return values from your compass heading function is fine for now. Just make sure everything works as you expect (i.e. when you click on a point in the custom object, the correct compass heading is printed to the debug console).
4) Once this is all working, you need some way to do something with the compass heading. You have a few options here: You can have the custom object send a message to some other designated object with the compass heading as part of it, or you can simply let some other object know that there's a compass heading ready, and provide the most recently selected compass heading as a property that can be queried (as mduser suggested above).
You don't necessarily have to do these steps in order, but I strongly suggest you do so, as solving each of these successive problems will make it more clear what exactly you're trying to accomplish in the next step.
Good luck, and please do feel free to ask questions if you're confused or stuck on anything!