It should work if you just create an empty Cocoa project in Xcode and follow these steps:
First, in the interface section of your AppDelegate.h, enter this line:
-(IBAction)openLink:(id)sender;
Second, in the implementation section of your AppDelegate.m, enter these lines:
-(IBAction)openLink:(id)sender
{
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://www.stackoverflow.com"]];
}
Third, make a connection between your method and the menu item. Do this in Interface Builder. There are several ways to do this, a simple one is first to click on the menu item you want to connect:

Then head over to the connections pane at the right side of the IB window:

There click & hold on the small circle next to the description "selector" and drag the mouse to the left. It should look like this:

Move the mouse to the left until the pointer is over the "AppDelegate" item in the left part of IB:

Now (last step!) a little window will pop up asking you to which method of your AppDelegate you want to connect the menu item. Just click on the openLink: method, and you're done:

If you now run your program and click on the menu item you've connected to the openLink: method, the link will open in your default web browser (not necessarily Safari).