how to write views for our own custom module?
In order to be able to use a custom module's table with Views, you need to use hook_views_data().

Even better, I would recommend that you invest some time to learn about entities. Entities are much better for most and thay can be almost immediately used in views.

To define a custom view into your module, put it in file module.views_default.inc (replacing with your module name), in a function module_views_default_views().