Migrate users from Drupal 5 to Drupal 7 I want to migrate users from a Drupal 5 site to a Drupal 7 site.

I have enabled the Migrate and Drupal-to-Drupal data migration modules. 

I know I have to make a custom module extending the built in classes of migrate_d2d module to migrate users. The problem is:- which migrate class do I extend while making the custom class? 

And am I right in thinking that that code for creating the custom class should be placed in user.inc file? 

I am migrating content from one database (legacy) to another database (active).
Upgrade from Drupal 5 to 6, then from 6 to 7. That's it. No further modules or writing your own code is needed, users and content will migrate just fine. You only need Migrate and other modules if you have some special stuff on your site, like Organic groups. CCK version 7 will be needed in most cases, but that's all in the documentation.

Here's the documentation, follow carefully:

From 5 to 6: https://drupal.org/documentation/upgrade/5/6

From 6 to 7: https://drupal.org/documentation/upgrade