I want it to done automatically when an event is created in salesforce an event has to get created in outlook
This is exactly what the Salesforce for Outlook does. It's an addon for Outlook provided by Salesforce.
You'd need to define exactly how you'd want this to work, and who has access to it by going to:
Setup > Desktop Administration > Outlook Configurations
Here you'd need to create and make active a configuration.
You can download the application itself by going to My Settings.
Once downloaded, you'd need to sign into Salesforce via the app and follow the installation process from there (e.g. what you want to sync, should it sync private items etc...)