Add a custom VBO action I want to add a custom VBO action. 

It display in the actions list of the view, it should like a tree, like this:

-Add Role-

RoleA

RoleB

-Remove Role-

RoleA

RoleB

And When I select RoleA(-Remove Role-), check some users, click the submit.

The users checked should be removed RoleA.

How can I code a custom VBO action like this ?
You can create custom VBO action by implementing hook_action_info() hook. Here are some useful links which can help you achieve what you want: 


Views Bulk Operations development guide (Drupal 7)

Programmatically adding and removing roles to users in Drupal
HOWTO assign a user to a role programatically


additionally, Examples module can help you to learn about Actions.