Next when you have a caravan enter the map the caravan icon on the top right side of the screen will get a red border around it.. .and you will also get an announcement. But you can't trade till he gets to the market.
Once he is ready to trade, press F4 or click the caravan icon.. to bring up the trade window
First an image of it:
http://i.imgur.com/jfQjj.png

Now what each box is..
1). Is the money the caravan has to spend.
2). Is the money your town currently has.
3). Is how much money you are getting or losing atm.. If it is negative (red) you are gaining money from the caravan, if it is positive (black) you are spending money.
If you have a negative number it cannot be higher then the caravans gold (if it is he cannot afford the trade).
If you have a positive number it cannot be higher then the towns gold (if it is you cannot afford the trade).
4). This is the caravans inventory, click things here to move them to the next box (5.).
5). This is the buying list.. Everything in this list you are current buying from the caravan, just click items here to cancel them.
6). This is the sell list, everything in this list you are selling to the caravan. Click items here to cancel selling it.
7) This is your towns inventory list.. Only items the caravan wants to buy will be in the list.. different caravans buy different things. Click items in this list to sell them.
8). Is the Finish trade button once you have all the things you want to buy and sell set up, click this to end your trade with the caravan.
Some extra info about the caravans..
It is fine to open and close the caravan window as many times as you want, while making the trade using the F4 or caravan icon.. but once you click trade you may not edit the trade any longer.
Caravans do not seem to come in the first week of the game.
Caravans will come about once a week sometimes quicker some times longer.
You can only make 1 trade with a caravan (you can trade for as many items as you want/sell as many as you want.. as long as you can afford it or he can, but once you click finish trade, that's it).
Caravans only stay in town for two days then they leave. So you must start your trade before they leave.
When you finish the trade in the trade window townies will immediately drop every other task and haul any items you said to sell to the caravan.
The caravan will drop off the items you bought from it.. if you did not have enough gold to buy an item but sold enough items to afford it - he will not drop the item until enough items are sold to him for you to have the gold to buy it... he drops all items in the market zone.
Every time a townie gives a caravan an item, they will reset the caravans stay counter to two more days.... so once the trade is started, you usually should not have to worry about getting everything hauled to him to finish the trade.
Due to a change in .60a Now only 30% of your town at any given time will bring items to the caravan so you should not need to worry about how big a trade is.
Also try to avoid selling to many items that are deep in the dungeons... (double check your stores and where things are if need be). While this is allowed, it can lead to the townie(s) starving if the trip is very long and they got hungry just after they started the task (unlikely but it can happen). It is best to try to haul things back close to town before selling it to a caravan.
To mod caravans you use the caravan.xml but you also need to add a new living for each new caravan you add.. for them to come.
I'll edit in any other useful info that may come up...
Any questions feel free to ask and I can try to help.