Existence and examples of quantum isometry group for a class of compact metric spaces