The topic has to have the topic_vote set to 1, that's how it knows there is a poll. From there you need to enter rows in two more tables. The code to do that isn't too bad. The sample is either in posting.php or includes/functions_posts.php I think.
The tables you need to populate are phpbb_vote_desc
which contains the title of the poll and the link to the topic and the expiration date, and the phpbb_vote_results
which contains the options (choices) in the poll.
Questions for help coding like this are best asked in the MOD Writers forum, so I'll move your question there now. Good luck with your project.