My legal practice is mostly startup tech companies in Toronto, Canada. Every week I have two or three new founder teams who come in and ask what they need to do to start a tech company. Here's a general outline of the legal steps* necessary to start a software company in Canada:
Step 0: Talk to a Lawyer
If you can afford it, the best way to start your company is to have a lawyer guide you through the process.
Step 1: Figure Out The Team
Who are your team members? Will they get equity (stock)? Will they be paid on contract? Will they be employees? (Most people try to avoid the latter if possible.)
The first step is to understand who's on your team and how you'll be working together. Often there's a contract programmer who is considered to be on the team but doesn't want equity (they want cash). Understand what everyone will contribute and what they'll get.
Step 2: More Than One Founder?
Step 3: Incorporate
Incorporating is almost always the right move for a tech startup. Among the many reasons to do this are that there are better tax credits for incorporated businesses (e.g. SR&ED).
If you're just starting off then a sole proprietorship or partnership might be a more appropriate vehicle for your software business.
Step 4: Shareholders' and Directors' Resolutions
These are the formal steps necessary to turn a freshly incorporated company into your company (re: this is how you issue the initial shares).
Self-incorporators can miss this essential step. Filing through Corporations Canada is not the end of the process!
Step 5: Independent Contractor Agreements
Many businesses have contract programmers. It's essential to make sure that you own the IP that they're producing (don't rely on your contractor's agreement [that they downloaded off the Internet]).
Step 6: Assign IP to Company
Make sure all of the IP (software code, graphics, etc.) is assigned to the company. Investors will want to see the stack of paperwork that shows that you own all your own code. Often there's pre-incorporation IP that needs to be moved into the company.
Step 7: Accounting
An accountant can save you a lot of money and you should consider getting one. They can probably also help with tax credits.
Step 8: Make Something
Getting the legal steps right is great but if you don't make something people want to use then you don't have a business.
*This is a general guide with legal information (not advice) about the steps commonly taken to set up a tech company properly. There are many books written on this subject and this is obviously a quick summary. Please consult with a tech lawyer (like me) to obtain proper legal advice about your situation.