Free WordPress blog means wordpress.com blogs which aren't self-hosted. There are quite limitations to wordpress.com blogs because of interface and all that. I recommend you to transfer your blog as quickly as possible to wordpress.org, you can boost your blogging and also it has much more features and makes it simple.
Regarding your query, when you write a post there will be a tab indicating visual & code. The visual editor is the general one where you write your post and when you switch your tab to code, you will get HTML version of the post you write. So, to add a code switch to Html version and add your code and save it.
This process is same for post/ page and as I said earlier there are certain limitations and only specific HTML codes work with it. So better to move to self-hosted one.
Regarding widgets, the free version will have only a few widgets available to our use, for more options you need to convert your blog by adding custom domain like xya.wordpress.com to xya.com. For this, you need to pay the amount and get registered domain and all that. Then you will have access to all the widgets and you can customize through it.