You create the vlan at L2 in the vlan database -
switch(config)# vlan <vlan ID>
switch(config-vlan)# name <vlan name>
then you create a L3 interface for the vlan (SVI) -
switch(config)# int vlan <vlan ID>
switch(config-if)# ip address x.x.x.x <subnet mask>
then you allocate ports into that vlan and any clients are allocated an IP from the same subnet and their default gateway is the SVI IP address above.
Jon