How to add a post from a custom PHP form?

I’ve written a diary management system that I’ve used on other websites before. I’m currently migrating it to WP and some advice on creating post.

The diary is basically a database that stores dates, it’s updated via PHP forms…..I have this all up and running from within WP pages but i’d like to be able to create a post every time a new date is entered into the database.
I’ve read some things about creating basic posts in this way but I’m wondering how I go about creating custom fields to store the data in the post……ie, I need to be able to store the event date in a date field within the post as opposed to simply storing the date as text in the body of the post.

If someone could point me in the right direction, I would be very greatful.